fake-promise
Version:
Gives full control over when ES6 promises are resolved by providing an implementation of Promise with behavior controlled by .resolve(result) and .reject(error) methods. Intended for use in unit tests.
48 lines (35 loc) • 866 B
JavaScript
// Generated by CoffeeScript 2.5.1
(function() {
var errors, maybeThrow;
require("source-map-support").install();
require("should");
require("should-sinon");
require("colors");
errors = [];
process.on("uncaugthException", function(error) {
return errors.push({
type: "uncaughtException",
error
});
});
process.on("unhandledRejection", function(error) {
return errors.push({
type: "unhandledRejection",
error
});
});
maybeThrow = function() {
var message;
if (errors.length === 0) {
return;
}
message = errors.map(def(() => {
return `${def.type}${def.error.stack}\n`;
})).join("");
errors.splice(0, errors.length);
throw new Error(message);
};
beforeEach(maybeThrow);
afterEach(maybeThrow);
}).call(this);
//# sourceMappingURL=mocha.config.js.map