shelljs/scripts/run-tests.js
Nate Fischer 2395214fee chore: switch to eslint (#504)
* chore: switch to eslint

* fix: works on older versions of NodeJS now

* chore: fix curly braces

* chore: fix indents and remove jshint references
2016-08-07 12:16:29 -07:00

30 lines
694 B
JavaScript
Executable File

#!/usr/bin/env node
/* globals cd, echo, exec, exit, ls */
require('../global');
var failed = false;
//
// Unit tests
//
cd(__dirname + '/../test');
ls('*.js').forEach(function (file) {
echo('Running test:', file);
if (exec(JSON.stringify(process.execPath) + ' ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit)
failed = true;
echo('*** TEST FAILED! (missing exit code "123")');
echo();
}
});
echo();
if (failed) {
echo('*******************************************************');
echo('WARNING: Some tests did not pass!');
echo('*******************************************************');
exit(1);
} else {
echo('All tests passed.');
}