UNPKG

@n1k1t/mock-server

Version:

The ultimate toolkit to intercept, transform, and simulate HTTP/WS traffic with type-safe expectations

56 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildExpectationContext = void 0; const models_1 = require("../../server/models"); const buildExpectationContext = () => ({ storage: new models_1.ContainersStorage({ group: 'test' }), transport: 'http', state: {}, flags: {}, cache: { isEnabled: false, }, incoming: { type: 'json', path: '/foo/bar/baz', method: 'POST', query: { foo: 1, bar: { baz: null, }, }, data: { foo: [ { bar: 1 }, { baz: ['2'] }, ], }, headers: { 'content-type': 'application/json', 'accept-language': 'en/gb', }, raw: { data: Buffer.from('{"foo": [{"bar": 1}, {"baz": ["2"]}]}'), }, }, outgoing: { type: 'json', status: 200, data: { foo: { bar: { baz: true, }, }, }, headers: { 'content-type': 'application/json', }, raw: { data: Buffer.from('{"foo": {"bar": {"baz": true}}}'), }, }, }); exports.buildExpectationContext = buildExpectationContext; //# sourceMappingURL=index.js.map