@thisisagile/easy-test
Version:
Straightforward library for testing microservices built with @thisisagile/easy
14 lines • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBeQueriedWith = void 0;
const Match_1 = require("./Match");
const toBeQueriedWith = (query, expected) => (0, Match_1.match)(query?.mock?.calls)
.undefined(c => c, 'Query is unknown.')
.not(c => c.length === 1, 'Query did not execute.')
.not(c => c[0][0].toString() === expected?.toString(), c => `We expected query '${expected}', but we received query '${c[0][0]}' instead.`)
.else(`Received query does match '${expected}'`);
exports.toBeQueriedWith = toBeQueriedWith;
expect.extend({
toBeQueriedWith: exports.toBeQueriedWith,
});
//# sourceMappingURL=toBeQueriedWith.js.map