Skip to content

Commit 2998a0a

Browse files
committed
throw error on process exit,
to not let madge Promise eat up the test circular dep error.
1 parent 80e2ea4 commit 2998a0a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Diff for: tasks/test_syntax.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ var libGlob = path.join(constants.pathToLib, '**/*.js');
1111
var testGlob = path.join(constants.pathToJasmineTests, '**/*.js');
1212
var bundleTestGlob = path.join(constants.pathToJasmineBundleTests, '**/*.js');
1313

14+
var EXIT_CODE = 0;
15+
1416
// main
1517
assertJasmineSuites();
1618
assertSrcContents();
@@ -133,9 +135,15 @@ function combineGlobs(arr) {
133135

134136
function log(name, logs) {
135137
if(logs.length) {
136-
console.error('test-syntax error [' + name + ']\n');
137-
throw new Error('\n' + logs.join('\n') + '\n');
138+
console.error('test-syntax error [' + name + ']');
139+
EXIT_CODE = 1;
140+
} else {
141+
console.log('ok ' + name);
138142
}
139-
140-
console.log('ok ' + name);
141143
}
144+
145+
process.on('exit', function() {
146+
if(EXIT_CODE) {
147+
throw new Error('test syntax failed.');
148+
}
149+
});

0 commit comments

Comments
 (0)