UNPKG

@n1k1t/mock-server

Version:

Powerful util to setup mocks over HTTP APIs

33 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Client = void 0; const helpers_1 = require("../helpers"); class Client { constructor(methods) { this.methods = methods; } get ping() { return this.methods.ping; } get deleteExpectations() { return this.methods.deleteExpectations; } createExpectation(predicate) { return typeof predicate === 'function' ? this.methods.createExpectation(predicate(this.compileHandlerUtils())) : this.methods.createExpectation(predicate); } updateExpectation(predicate) { return typeof predicate === 'function' ? this.methods.updateExpectation(predicate(this.compileHandlerUtils())) : this.methods.updateExpectation(predicate); } compileHandlerUtils() { return { $: (0, helpers_1.compileExpectationOperators)(), T: (payload) => payload, }; } } exports.Client = Client; //# sourceMappingURL=client.js.map