({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {})
| 41 | } |
| 42 | |
| 43 | respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) { |
| 44 | this.status = status; |
| 45 | this.statusText = statusText; |
| 46 | this.responseText = responseText; |
| 47 | this.response = responseText; |
| 48 | this.responseHeaders = responseHeaders; |
| 49 | this.readyState = 4; |
| 50 | |
| 51 | queueMicrotask(() => { |
| 52 | if (this.onloadend) { |
| 53 | this.onloadend(); |
| 54 | } else if (this.onreadystatechange) { |
| 55 | this.onreadystatechange(); |
| 56 | } |
| 57 | }); |
| 58 | } |
| 59 | |
| 60 | abort() { |
| 61 | this.statusText = 'abort'; |
no outgoing calls
no test coverage detected