import { addProperty } from "https://dotland.deno.dev/x/chai@v5.1.2/lib/chai/utils/addProperty.js";
.addProperty(ctx, name, getter)
Adds a property to the prototype of an object.
utils.addProperty(chai.Assertion.prototype, 'foo', function () {
var obj = utils.flag(this, 'object');
new chai.Assertion(obj).to.be.instanceof(Foo);
});
Can also be accessed directly from chai.Assertion
.
chai.Assertion.addProperty('foo', fn);
Then can be used as any other assertion.
expect(myFoo).to.be.foo;