@thisisagile/easy-test
Version:
Straightforward library for testing microservices built with @thisisagile/easy
15 lines • 818 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBeArrayOfWithLength = void 0;
const Match_1 = require("./Match");
const toBeArrayOfWithLength = (items, ctor, length) => (0, Match_1.match)(items)
.undefined(it => it, 'Subject is undefined.')
.not(it => it instanceof Array, 'Subject is not an array.')
.not(it => it.length === length, it => `Subject does not have ${length} elements, but ${it.length}.`)
.not(it => it.every((i) => i instanceof ctor), `Not all elements are of type '${ctor.name}'.`)
.else(`Subject has ${length} elements, which are all of type '${ctor.name}'`);
exports.toBeArrayOfWithLength = toBeArrayOfWithLength;
expect.extend({
toBeArrayOfWithLength: exports.toBeArrayOfWithLength,
});
//# sourceMappingURL=toBeArrayOfWithLength.js.map