UNPKG

@thisisagile/easy-test

Version:

Straightforward library for testing microservices built with @thisisagile/easy

26 lines (25 loc) 795 B
import { match } from "../chunk-LN24S2PC.mjs"; import "../chunk-6EKWTLNQ.mjs"; import { isDefined } from "../chunk-O475TEG2.mjs"; // src/matchers/toBeExactlyAt.ts var toUrl = (uc, id) => { const i = isDefined(id) ? `/${id}` : ""; return `/${uc.app.id}/${uc.id}${i}`; }; var toBeExactlyAt = (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(toUrl(uc, id)), (t) => `We expected the tester to be at: '${toUrl(uc, id)}', but it is at: '${t?.url}' instead.` ).else((t) => `The tester is at '${t?.url}'`); }; expect.extend({ toBeExactlyAt }); export { toBeExactlyAt }; //# sourceMappingURL=toBeExactlyAt.mjs.map