()
| 45 | } |
| 46 | |
| 47 | private getBody(): string { |
| 48 | if (this.bodyUsed === true) { |
| 49 | throw new Error('Cannot reuse body without cloning.'); |
| 50 | } |
| 51 | this.bodyUsed = true; |
| 52 | |
| 53 | // According to the spec, a `null` body results in an empty `ReadableStream` (which for our |
| 54 | // needs is equivalent to `''`). See https://fetch.spec.whatwg.org/#concept-body-consume-body. |
| 55 | return this._body || ''; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | export class MockHeaders implements Headers { |
no outgoing calls
no test coverage detected