Fix failing tests for rhino -require.

This commit is contained in:
John-David Dalton
2013-10-24 09:09:18 -07:00
parent 5929676ea2
commit e2c5e92cd3
2 changed files with 17 additions and 20 deletions

View File

@@ -173,26 +173,23 @@
console.log(' Finished in ' + details.runtime + ' milliseconds.');
console.log(hr);
var fails = details.failed,
error = fails + ' of ' + details.total + ' tests failed.';
// exit out of Node.js or PhantomJS
try {
var process = context.process || context.phantom;
if (fails) {
console.error('Error: ' + error);
if (details.failed) {
process.exit(1);
} else {
process.exit(0);
}
} catch(e) {
if (fails) {
throw new Error(error);
}
}
// exit out of Narhwal, Rhino, or RingoJS
} catch(e) { }
// exit out of Narwhal, Rhino, or RingoJS
try {
quit();
if (details.failed) {
java.lang.System.exit(1);
} else {
quit();
}
} catch(e) { }
};
}());