<commit_before>var finder = (function () {

var exports = {};

var _ = require('node_modules/underscore/underscore.js');
var fs = require('fs');
var path = require('path');

exports.find_files_to_run = function () {
    var oneFileFilter = [];
    var testsDifference = [];
    if (process.argv[2]) {
        oneFileFilter = process.argv
          .slice(2)
          .filter(function (filename) {return (/[.]js$/).test(filename);})
          .map(function (filename) {return filename.replace(/\.js$/i, '');});
    }

    // tests_dir is where we find our specific unit tests (as opposed
    // to framework code)
    var tests_dir = __dirname.replace(/zjsunit/, 'node_tests');

    var tests = fs.readdirSync(tests_dir)
      .filter(function (filename) {return (/\.js$/i).test(filename);})
      .map(function (filename) {return filename.replace(/\.js$/i, '');});

    if (oneFileFilter.length > 0) {
        tests = tests.filter(function (filename) {
            return oneFileFilter.indexOf(filename) !== -1;
        });
        testsDifference = _.difference(oneFileFilter, tests);<commit_msg>zjsunit: Don't run tests on editor backup files.<commit_after>var finder = (function () {

var exports = {};

var _ = require('node_modules/underscore/underscore.js');
var fs = require('fs');
var path = require('path');

exports.find_files_to_run = function () {
    var oneFileFilter = [];
    var testsDifference = [];
    if (process.argv[2]) {
        oneFileFilter = process.argv
          .slice(2)
          .filter(function (filename) {return (/[.]js$/).test(filename);})
          .map(function (filename) {return filename.replace(/\.js$/i, '');});
    }

    // tests_dir is where we find our specific unit tests (as opposed
    // to framework code)
    var tests_dir = __dirname.replace(/zjsunit/, 'node_tests');

    var tests = fs.readdirSync(tests_dir)
      .filter(function (filename) {return !(/^\./i).test(filename);})
      .filter(function (filename) {return (/\.js$/i).test(filename);})
      .map(function (filename) {return filename.replace(/\.js$/i, '');});

    if (oneFileFilter.length > 0) {
        tests = tests.filter(function (filename) {
            return oneFileFilter.indexOf(filename) !== -1;
        });
        testsDifference = _.difference(oneFileFilter, tests);
{'fraction_non_alphanumeric': 0.16862233811386354, 'fraction_numerical': 0.003476749239461104, 'mean_word_length': 3.0034782608695654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5607026', 'n_tokens_mistral': 719, 'n_tokens_neox': 691, 'n_words': 156}