@thisisagile/easy-test
Version:
Straightforward library for testing microservices built with @thisisagile/easy
27 lines (26 loc) • 788 B
JavaScript
import {
eq
} from "../chunk-QE3TR4BY.mjs";
import {
match
} from "../chunk-LN24S2PC.mjs";
import "../chunk-6EKWTLNQ.mjs";
import {
asJson
} from "../chunk-O475TEG2.mjs";
// src/matchers/toMatchJson.ts
var MatchesJson = {
SubjectUndefined: "Subject is undefined.",
SubsetUndefined: "Subset to match with is undefined.",
DoesNotMatch: "Subset does not match subject.",
Yes: "Subset matches subject"
};
var toMatchJson = (value, subset) => match(value).undefined((v) => v, MatchesJson.SubjectUndefined).undefined(() => subset, MatchesJson.SubsetUndefined).not((v) => eq.subset(asJson(v), asJson(subset)), MatchesJson.DoesNotMatch).else(() => MatchesJson.Yes);
expect.extend({
toMatchJson
});
export {
MatchesJson,
toMatchJson
};
//# sourceMappingURL=toMatchJson.mjs.map