mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
Plenty of errors surfaced with better test coverage. Aside from fixing the broken implementations, this also prompted me to fully implement the dirs command. Also changed the run-tests script to always set cwd to the test folder, so that tests that change cwd don't affect others (ehum, that'd be mine.) More tests to follow.
27 lines
677 B
JavaScript
Executable File
27 lines
677 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
require('../global');
|
|
|
|
var path = require('path');
|
|
|
|
var failed = false;
|
|
|
|
cd(__dirname + '/../test');
|
|
ls('*.js').forEach(function(file) {
|
|
echo('Running test:', file);
|
|
if (exec('node ' + file, { cwd: path.resolve(__dirname, '/../test') }).code !== 123) { // 123 avoids false positives (e.g. premature exit)
|
|
failed = true;
|
|
echo('*** TEST FAILED! (missing exit code "123")');
|
|
}
|
|
});
|
|
|
|
if (failed) {
|
|
echo();
|
|
echo('*******************************************************');
|
|
echo('WARNING: Some tests did not pass!');
|
|
echo('*******************************************************');
|
|
exit(1);
|
|
} else {
|
|
echo();
|
|
echo('All tests passed.');
|
|
}
|