({
status = 200,
statusText = 'OK',
responseText = '',
response = null,
responseHeaders = {},
headers = {},
responseURL = '',
} = {})
| 53 | } |
| 54 | |
| 55 | respondWith({ |
| 56 | status = 200, |
| 57 | statusText = 'OK', |
| 58 | responseText = '', |
| 59 | response = null, |
| 60 | responseHeaders = {}, |
| 61 | headers = {}, |
| 62 | responseURL = '', |
| 63 | } = {}) { |
| 64 | this.status = status; |
| 65 | this.statusText = statusText; |
| 66 | this.responseText = responseText; |
| 67 | this.response = response === null ? responseText : response; |
| 68 | this.responseHeaders = Object.keys(headers).length ? headers : responseHeaders; |
| 69 | this.responseURL = responseURL; |
| 70 | this.readyState = 4; |
| 71 | this.finish(); |
| 72 | } |
| 73 | |
| 74 | responseTimeout() { |
| 75 | if (this.ontimeout) { |
no test coverage detected