public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63d04ff
)
Add an exit code to the test suite
author
Richard van Velzen
<rvanvelzen1@gmail.com>
Wed, 23 Oct 2013 18:24:58 +0000
(20:24 +0200)
committer
Richard van Velzen
<rvanvelzen1@gmail.com>
Wed, 23 Oct 2013 18:24:58 +0000
(20:24 +0200)
By adding the exit code 1 (or any other non-zero exit code) `npm test`
will know the tests didn't perform correctly. This way it's easier to
know if pull requests are good or bad.
test/run-tests.js
patch
|
blob
|
history
diff --git
a/test/run-tests.js
b/test/run-tests.js
index
0568c6a
..
a3268dc
100755
(executable)
--- a/
test/run-tests.js
+++ b/
test/run-tests.js
@@
-7,8
+7,10
@@
var assert = require("assert");
var sys = require("util");
var tests_dir = path.dirname(module.filename);
+var failures = 0;
run_compress_tests();
+if (failures) process.exit(1);
/* -----[ utils ]----- */
@@
-83,6
+85,7
@@
function run_compress_tests() {
output: output,
expected: expect
});
+ failures++;
}
}
var tests = parse_test(path.resolve(dir, file));