UNPKG

@plugjs/expect5

Version:

Unit Testing for the PlugJS Build System ========================================

18 lines (17 loc) 617 B
// expectation/expect.ts import { AsyncExpectations } from "./async.mjs"; import { Matcher } from "./matchers.mjs"; var expect = ((value, remarks) => { return new AsyncExpectations(value, remarks); }); for (const key of Object.getOwnPropertyNames(Matcher.prototype)) { if (!key.startsWith("to")) continue; const matcher = (...args) => new Matcher()[key](...args); Object.defineProperty(matcher, "name", { value: key }); Object.defineProperty(expect, key, { value: matcher }); } Object.defineProperty(expect, "not", { get: () => new Matcher().not }); export { expect }; //# sourceMappingURL=expect.mjs.map