Method
respondWith
({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {})
Source from the content-addressed store, hash-verified
| 40 | } |
| 41 | |
| 42 | respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) { |
| 43 | this.status = status; |
| 44 | this.statusText = statusText; |
| 45 | this.responseText = responseText; |
| 46 | this.response = responseText; |
| 47 | this.responseHeaders = responseHeaders; |
| 48 | this.readyState = 4; |
| 49 | |
| 50 | queueMicrotask(() => { |
| 51 | if (this.onloadend) { |
| 52 | this.onloadend(); |
| 53 | } else if (this.onreadystatechange) { |
| 54 | this.onreadystatechange(); |
| 55 | } |
| 56 | }); |
| 57 | } |
| 58 | |
| 59 | abort() {} |
| 60 | } |
Tested by
no test coverage detected