Comparing version 0.5.13 to 0.5.14
@@ -110,3 +110,3 @@ #!/usr/bin/env node | ||
if (err) { | ||
console.error(new Error(err)); | ||
console.error(err); | ||
process.exit(1); | ||
@@ -113,0 +113,0 @@ return; |
@@ -17,2 +17,3 @@ var QUnit = require('../support/qunit/qunit/qunit.js'), | ||
process.on('uncaughtException', function(err) { | ||
process.send({event: 'uncaughtException'}); | ||
if (QUnit.config.current) { | ||
@@ -19,0 +20,0 @@ QUnit.ok(false, 'Test threw unexpected exception: ' + err); |
@@ -9,3 +9,4 @@ var fs = require('fs'), | ||
var options; | ||
var options, | ||
noop = function() {}; | ||
@@ -76,5 +77,7 @@ options = exports.options = { | ||
} | ||
callback(msg.data); | ||
callback(null, msg.data); | ||
kill(); | ||
} else if (msg.event === 'uncaughtException') { | ||
callback(new Error('Uncaught exception in child process.')); | ||
kill(); | ||
} | ||
@@ -134,2 +137,4 @@ }); | ||
callback || (callback = noop); | ||
if (!Array.isArray(files)) { | ||
@@ -147,3 +152,7 @@ files = [files]; | ||
function finished(stat) { | ||
function done(err, stat) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
filesCount++; | ||
@@ -158,5 +167,3 @@ | ||
if (typeof callback === 'function') { | ||
callback(null, log.stats()); | ||
} | ||
callback(null, log.stats()); | ||
} | ||
@@ -168,3 +175,3 @@ } | ||
} else { | ||
runOne(opts, finished); | ||
runOne(opts, done); | ||
} | ||
@@ -171,0 +178,0 @@ }); |
{ | ||
"name": "qunit", | ||
"description": "QUnit testing framework for nodejs", | ||
"version": "0.5.13", | ||
"version": "0.5.14", | ||
"author": "Oleg Slobodskoi <oleg008@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -29,2 +29,2 @@ test('myMethod test', function() { | ||
ok(true, 'date modified'); | ||
}); | ||
}); |
@@ -45,2 +45,3 @@ var a = require('assert'), | ||
a.equal(err, null, 'no errors'); | ||
a.ok(res.runtime > 0, 'Date was modified'); | ||
@@ -67,2 +68,3 @@ delete res.runtime; | ||
delete res.runtime; | ||
a.equal(err, null, 'no errors'); | ||
a.deepEqual(stat, res, 'attaching code to global works'); | ||
@@ -88,2 +90,3 @@ chain.next(); | ||
delete res.runtime; | ||
a.equal(err, null, 'no errors'); | ||
a.deepEqual(stat, res, 'attaching dependencies to global works'); | ||
@@ -111,2 +114,3 @@ chain.next(); | ||
delete res.runtime; | ||
a.equal(err, null, 'no errors'); | ||
a.deepEqual(stat, res, 'attaching code to specified namespace works'); | ||
@@ -131,2 +135,3 @@ chain.next(); | ||
delete res.runtime; | ||
a.equal(err, null, 'no errors'); | ||
a.deepEqual(stat, res, 'async code testing works'); | ||
@@ -137,4 +142,14 @@ chain.next(); | ||
chain.add('uncaught exception', function() { | ||
tr.run({ | ||
code: fixtures + '/uncaught-exception-code.js', | ||
tests: fixtures + '/uncaught-exception-test.js', | ||
}, function(err, res) { | ||
a.ok(err instanceof Error, 'error was forwarded') | ||
chain.next(); | ||
}); | ||
}); | ||
chain.add(function() { | ||
console.log('\nAll tests done'); | ||
console.log('\nAll tests ok.'); | ||
}); | ||
@@ -141,0 +156,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
236253
66
5872