blob: d3b5ebc000ea8edc3ecc86778181f733f370b05f (
plain) (
tree)
|
|
const { expect } = require('chai');
module.exports = async function expectError(promised, message) {
let thrown = false;
try {
await promised;
} catch (e) {
thrown = true;
expect(message).to.be.equal(e.message);
}
if (!thrown) {
throw new Error('Function did not throw');
}
};
|