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