(timeoutMs = 1000)
| 69 | let OriginalXMLHttpRequest; |
| 70 | |
| 71 | const waitForRequest = async (timeoutMs = 1000) => { |
| 72 | const start = Date.now(); |
| 73 | |
| 74 | while (Date.now() - start < timeoutMs) { |
| 75 | const request = requests.at(-1); |
| 76 | if (request) { |
| 77 | return request; |
| 78 | } |
| 79 | |
| 80 | await Promise.resolve(); |
| 81 | } |
| 82 | |
| 83 | throw new Error('Expected an XHR request to be sent'); |
| 84 | }; |
| 85 | |
| 86 | describe('cancel (vitest browser)', () => { |
| 87 | beforeEach(() => { |
no outgoing calls
no test coverage detected