blob: 214ea446d93f40e403493affd122ebc2a51b75ca [file] [log] [blame]
"use strict";
var currentListener = null;
var currentError = null;
beforeEach(function (done) {
currentError = null;
currentListener = function (error) {
currentError = error;
};
testUtils.addUnhandledRejectionListener(currentListener);
done();
});
afterEach(function (done) {
testUtils.removeUnhandledRejectionListener(currentListener);
if (currentError) {
if (currentError instanceof PromiseRejectionEvent) {
currentError = currentError.reason;
}
console.error(currentError);
}
done(currentError);
});