Files
rippled/test/mocha-loader-patch.js
Nicholas Dudfield 4dc2cf8a6b Update tests to support latest ripple-lib:
* Update ripple-lib api usage
* Use latest npm ripple-lib
  * Tested with bignumber.js branch and tip of develop
* Use new version of coffee-script
  * Better source maps
* Update mocha
* Add assert-diff for better error reporting
* Add rconsole, enabled via USE_RCONSOLE env var
  * For use with manual installation only
2015-01-26 19:13:40 -08:00

25 lines
609 B
JavaScript

mocha = require("mocha")
// Stash a reference away to this
old_loader = mocha.prototype.loadFiles
// Optionally use a more useful (but noisy) logger
if (process.env.USE_RCONSOLE) {
require('rconsole');
};
if (!old_loader.monkey_patched) {
// Gee thanks Mocha ...
mocha.prototype.loadFiles = function() {
try {
old_loader.apply(this, arguments);
} catch (e) {
// Normally mocha just silently bails
console.error(e.stack);
// We throw, so mocha doesn't continue trying to run the test suite
throw e;
}
}
mocha.prototype.loadFiles.monkey_patched = true;
};