UNPKG

@thisisagile/easy-test

Version:

Straightforward library for testing microservices built with @thisisagile/easy

26 lines (25 loc) 920 B
import { match } from "../chunk-LN24S2PC.mjs"; import "../chunk-6EKWTLNQ.mjs"; import "../chunk-O475TEG2.mjs"; // src/matchers/toBeAt.ts var toBeAt = (tester, uc, id) => { return match(tester).undefined((t) => t, "Tester is undefined").undefined((t) => t.url, "Tester does not contain a URL").undefined(() => uc, "Use case is undefined").not( (t) => t.url.includes(`/${uc?.app.id}`), (t) => `We expected the tester to be at app '${uc?.app.id}', but it is at '${t?.url}' instead.` ).not( (t) => t.url.includes(`/${uc?.id}`), (t) => `We expected the tester to be at use case '${uc?.id}', but it is at '${t?.url}' instead.` ).not( (t) => t.url.includes(id ? `/${id}` : ""), (t) => `We expected the path to contain '/42', but it is '${t?.url}' instead.` ).else((t) => `The tester is at '${t?.url}'`); }; expect.extend({ toBeAt }); export { toBeAt }; //# sourceMappingURL=toBeAt.mjs.map