(body = '', init = {})
| 61 | |
| 62 | class MockResponse { |
| 63 | constructor(body = '', init = {}) { |
| 64 | this.body = body; |
| 65 | this.status = init.status || 200; |
| 66 | this.statusText = init.statusText || ''; |
| 67 | this.headers = init.headers instanceof MockHeaders ? init.headers : new MockHeaders(init.headers || {}); |
| 68 | } |
| 69 | |
| 70 | async text() { |
| 71 | return typeof this.body === 'string' ? this.body : JSON.stringify(this.body); |
nothing calls this directly
no outgoing calls
no test coverage detected