jest-extended
Version:
Additional Jest matchers
15 lines (14 loc) • 547 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBeSealed = toBeSealed;
function toBeSealed(actual) {
// @ts-expect-error OK to have implicit any for this.utils
const { matcherHint } = this.utils;
const pass = Object.isSealed(actual);
return {
pass,
message: () => pass
? matcherHint('.not.toBeSealed', 'received', '') + '\n\nExpected object to be not sealed'
: matcherHint('.toBeSealed', 'received', '') + '\n\nExpected object to not sealed',
};
}