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