import { overwriteChainableMethod } from "https://dotland.deno.dev/x/chai@v5.1.2/lib/chai/utils/overwriteChainableMethod.js";
.overwriteChainableMethod(ctx, name, method, chainingBehavior)
Overwrites an already existing chainable method and provides access to the previous function or property. Must return functions to be used for name.
utils.overwriteChainableMethod(chai.Assertion.prototype, 'lengthOf',
function (_super) {
}
, function (_super) {
}
);
Can also be accessed directly from chai.Assertion
.
chai.Assertion.overwriteChainableMethod('foo', fn, fn);
Then can be used as any other assertion.
expect(myFoo).to.have.lengthOf(3);
expect(myFoo).to.have.lengthOf.above(3);