UNPKG

@n1k1t/mock-server

Version:

Powerful util to setup mocks over HTTP APIs

53 lines 1.34 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(), transport: 'http', event: 'connection', state: {}, flags: {}, cache: { isEnabled: false, }, incoming: { type: 'json', path: '/foo/bar/baz', method: 'POST', query: { foo: 1, bar: { baz: null, }, }, dataRaw: Buffer.from('{"foo": [{"bar": 1}, {"baz": ["2"]}]}'), data: { foo: [ { bar: 1 }, { baz: ['2'] }, ], }, headers: { 'content-type': 'application/json', 'accept-language': 'en/gb', }, }, outgoing: { type: 'json', status: 200, dataRaw: Buffer.from('{"foo": {"bar": {"baz": true}}}'), data: { foo: { bar: { baz: true, }, }, }, headers: { 'content-type': 'application/json', }, }, }); exports.buildExpectationContext = buildExpectationContext; //# sourceMappingURL=index.js.map