@thisisagile/easy-test
Version:
Straightforward library for testing microservices built with @thisisagile/easy
21 lines • 937 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toMatchExactJson = exports.MatchesExactJson = void 0;
const Match_1 = require("./Match");
const Eq_1 = require("../utils/Eq");
exports.MatchesExactJson = {
SubjectUndefined: 'Subject is undefined.',
SubsetUndefined: 'Object to match with is undefined.',
DoesNotMatch: 'Object does not exactly match subject.',
Yes: 'Object matches subject exactly',
};
const toMatchExactJson = (value, json) => (0, Match_1.match)(value)
.undefined(v => v, exports.MatchesExactJson.SubjectUndefined)
.undefined(() => json, exports.MatchesExactJson.SubsetUndefined)
.not(v => Eq_1.eq.exact(v, json), exports.MatchesExactJson.DoesNotMatch)
.else(() => exports.MatchesExactJson.Yes);
exports.toMatchExactJson = toMatchExactJson;
expect.extend({
toMatchExactJson: exports.toMatchExactJson,
});
//# sourceMappingURL=toMatchExactJson.js.map