mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-05 16:14:07 +00:00
CI: Exit when tests fail
This commit is contained in:
parent
0b7f72ce5c
commit
e9f2a24f30
@ -57,6 +57,16 @@ exports.startup = function() {
|
|||||||
includeStackTrace: true
|
includeStackTrace: true
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
// Add a reporter that exits with an error code if any tests failed
|
||||||
|
jasmineEnv.addReporter({
|
||||||
|
reportRunnerResults: function(runner) {
|
||||||
|
var c = runner.results().failedCount;
|
||||||
|
if(c > 0) {
|
||||||
|
console.log("Exitting with test failure count: ",c);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
// Iterate through all the test modules
|
// Iterate through all the test modules
|
||||||
var tests = $tw.wiki.filterTiddlers(TEST_TIDDLER_FILTER);
|
var tests = $tw.wiki.filterTiddlers(TEST_TIDDLER_FILTER);
|
||||||
$tw.utils.each(tests,function(title,index) {
|
$tw.utils.each(tests,function(title,index) {
|
||||||
@ -70,11 +80,7 @@ exports.startup = function() {
|
|||||||
$tw.utils.evalSandboxed(code,context,title);
|
$tw.utils.evalSandboxed(code,context,title);
|
||||||
});
|
});
|
||||||
// Execute the tests
|
// Execute the tests
|
||||||
jasmineEnv.execute(function(passed) {
|
jasmineEnv.execute();
|
||||||
if(!passed) {
|
|
||||||
process.exit(1); // Error if tests failed
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user