MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / MockRequest

Class MockRequest

tests/security/bff-proxy.test.js:43–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 class MockRequest {
44 constructor(url, init = {}) {
45 this.url = url;
46 this.method = init.method || 'GET';
47 this.headers = init.headers instanceof MockHeaders ? init.headers : new MockHeaders(init.headers || {});
48 this.body = init.body;
49 }
50
51 async arrayBuffer() {
52 const text = typeof this.body === 'string' ? this.body : JSON.stringify(this.body || '');
53 return new TextEncoder().encode(text).buffer;
54 }
55
56 async json() {
57 const text = typeof this.body === 'string' ? this.body : JSON.stringify(this.body || '');
58 return JSON.parse(text);
59 }
60 }
61
62 class MockResponse {
63 constructor(body = '', init = {}) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected