MCPcopy
hub / github.com/scality/cloudserver / prepareDummyRequest

Function prepareDummyRequest

tests/unit/routes/routeBackbeat.js:26–44  ·  view source on GitHub ↗
(headers = {}, body = '')

Source from the content-addressed store, hash-verified

24const log = new DummyRequestLogger();
25
26function prepareDummyRequest(headers = {}, body = '') {
27 const request = new DummyRequest(
28 {
29 hostname: 'localhost',
30 method: 'PUT',
31 url: '/_/backbeat/metadata/bucket0/key0',
32 port: 80,
33 headers,
34 socket: {
35 remoteAddress: '0.0.0.0',
36 destroy: () => {},
37 on: () => {},
38 removeListener: () => {},
39 },
40 },
41 body || '{"replicationInfo":"{}"}',
42 );
43 return request;
44}
45
46describe('routeBackbeat', () => {
47 let mockResponse;

Callers 3

routeBackbeat.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected