svgedit/cypress/support/assertion-wrapper.js

16 lines
438 B
JavaScript
Raw Normal View History

/**
* @param {external:chai} _chai
* @param {external:chai_utils} utils
* @returns {void}
*/
2021-05-09 17:29:45 +00:00
function setAssertionMethods (_chai, _utils) {
return (method) => {
return (...args) => {
const {result, message, actual, expected} = method(...args);
const assertion = new _chai.Assertion();
assertion.assert(result, `Expected ${actual} to be ${expected}`, message);
};
};
}
export default setAssertionMethods;