@thisisagile/easy-test
Version:
Straightforward library for testing microservices built with @thisisagile/easy
18 lines (17 loc) • 744 B
JavaScript
import {
match
} from "../chunk-LN24S2PC.mjs";
import "../chunk-6EKWTLNQ.mjs";
import "../chunk-O475TEG2.mjs";
// src/matchers/toBeArrayOfWithLength.ts
var toBeArrayOfWithLength = (items, ctor, length) => 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}'`);
expect.extend({
toBeArrayOfWithLength
});
export {
toBeArrayOfWithLength
};
//# sourceMappingURL=toBeArrayOfWithLength.mjs.map