diff options
| author | Marak <[email protected]> | 2021-03-22 16:31:25 -0400 |
|---|---|---|
| committer | Marak <[email protected]> | 2021-03-22 16:31:25 -0400 |
| commit | 10dd7e30cf49f03c34da1ab540df2172be40c8ea (patch) | |
| tree | a2ebc6179065775a9466a2148eb05a00fe6d23f7 /test/run.js | |
| parent | 0b75623dac94f6062ae623fa8bbfe0e81b205d4d (diff) | |
| download | faker-10dd7e30cf49f03c34da1ab540df2172be40c8ea.tar.xz faker-10dd7e30cf49f03c34da1ab540df2172be40c8ea.zip | |
Linting fixes for `./test`
Diffstat (limited to 'test/run.js')
| -rwxr-xr-x | test/run.js | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/test/run.js b/test/run.js index d577de9a..77a89bb7 100755 --- a/test/run.js +++ b/test/run.js @@ -7,17 +7,17 @@ var optimist = require('optimist'); var walk_dir = require('./support/walk_dir'); var argv = optimist - .usage("Usage: $0 -t [types] --reporter [reporter] --timeout [timeout]") - .default({types: 'unit,functional', reporter: 'spec', timeout: 6000}) - .describe('types', 'The types of tests to run, separated by commas. E.g., unit,functional,acceptance') - .describe('reporter', 'The mocha test reporter to use.') - .describe('timeout', 'The mocha timeout to use per test (ms).') - .boolean('help') - .alias('types', 'T') - .alias('timeout', 't') - .alias('reporter', 'R') - .alias('help', 'h') - .argv; + .usage("Usage: $0 -t [types] --reporter [reporter] --timeout [timeout]") + .default({types: 'unit,functional', reporter: 'spec', timeout: 6000}) + .describe('types', 'The types of tests to run, separated by commas. E.g., unit,functional,acceptance') + .describe('reporter', 'The mocha test reporter to use.') + .describe('timeout', 'The mocha timeout to use per test (ms).') + .boolean('help') + .alias('types', 'T') + .alias('timeout', 't') + .alias('reporter', 'R') + .alias('help', 'h') + .argv; var mocha = new Mocha({timeout: argv.timeout, reporter: argv.reporter, ui: 'bdd'}); @@ -26,43 +26,43 @@ var requested_types = argv.types.split(','); var types_to_use = []; valid_test_types.forEach(function (valid_test_type) { - if (requested_types.indexOf(valid_test_type) !== -1) { - types_to_use.push(valid_test_type); - } + if (requested_types.indexOf(valid_test_type) !== -1) { + types_to_use.push(valid_test_type); + } }); if (argv.help || types_to_use.length === 0) { - console.log('\n' + optimist.help()); - process.exit(); + console.log('\n' + optimist.help()); + process.exit(); } var is_valid_file = function (file) { - for (var i = 0; i < types_to_use.length; i++) { - var test_type = types_to_use[i]; - var ext = test_type + ".js"; + for (var i = 0; i < types_to_use.length; i++) { + var test_type = types_to_use[i]; + var ext = test_type + ".js"; - if (file.indexOf(ext) !== -1) { - return true; - } + if (file.indexOf(ext) !== -1) { + return true; } + } - return false; + return false; }; function run(cb) { - walk_dir.walk('test', is_valid_file, function (err, files) { - if (err) { return cb(err); } - - files.forEach(function (file) { - mocha.addFile(file); - }); + walk_dir.walk('test', is_valid_file, function (err, files) { + if (err) { return cb(err); } - cb(); + files.forEach(function (file) { + mocha.addFile(file); }); + + cb(); + }); } run(function (err) { - mocha.run(function (failures) { - process.exit(failures); - }); + mocha.run(function (failures) { + process.exit(failures); + }); }); |
