Skip to content

Commit a2fe981

Browse files
committed
#85, #84, #80 forward uncaughtException
1 parent 6f950ee commit a2fe981

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

lib/child.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ var options = JSON.parse(process.argv[2]),
1414
currentTest;
1515

1616
process.on('uncaughtException', function(err) {
17-
process.send({event: 'uncaughtException'});
1817
if (QUnit.config.current) {
19-
QUnit.ok(false, 'Test threw unexpected exception: ' + err);
18+
QUnit.ok(false, 'Test threw unexpected exception: ' + err.message);
2019
QUnit.start();
21-
} else {
22-
throw err;
2320
}
21+
process.send({
22+
event: 'uncaughtException',
23+
data: {
24+
message: err.message,
25+
stack: err.stack
26+
}
27+
});
2428
});
2529

2630
QUnit.config.autorun = false;

lib/testrunner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function runOne(opts, callback) {
7676
callback(null, msg.data);
7777
kill();
7878
} else if (msg.event === 'uncaughtException') {
79-
callback(new Error('Uncaught exception in child process.'));
79+
callback(_.extend(new Error, msg.data));
8080
kill();
8181
}
8282
});
@@ -148,7 +148,7 @@ exports.run = function(files, callback) {
148148

149149
function done(err, stat) {
150150
if (err) {
151-
return callback(err);
151+
return callback(err, log.stats());
152152
}
153153

154154
filesCount++;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "qunit",
33
"description": "QUnit testing framework for nodejs",
4-
"version": "0.5.17",
4+
"version": "0.5.18",
55
"author": "Oleg Slobodskoi <oleg008@gmail.com>",
66
"contributors": [
77
{"name": "Jonathan Buchanan"},

0 commit comments

Comments
 (0)