spec: Always run crash-reporter at last

So when a test crashed we can always see the stack trace.
This commit is contained in:
Cheng Zhao 2017-07-31 16:36:52 +09:00
parent 9ced85d860
commit 4b46eca329

View file

@ -62,16 +62,17 @@
if (query.invert) mocha.invert();
// Read all test files.
var walker = require('walkdir').walk(require('path').dirname(__dirname), {
var walker = require('walkdir').walk(path.dirname(__dirname), {
no_recurse: true
});
walker.on('file', function(file) {
if (/-spec\.js$/.test(file))
if (/-spec\.js$/.test(file) && !file.includes('api-crash-reporter-spec.js'))
mocha.addFile(file);
});
walker.on('end', function() {
mocha.addFile(path.resolve(__dirname, '..', 'api-crash-reporter-spec.js'))
var runner = mocha.run(function() {
if (isCi && runner.hasOnly) {
try {