Skip to content

Commit

Permalink
document request abort test more
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonstreator committed Dec 9, 2023
1 parent c3a30f9 commit 7065708
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ describe('app', () => {
} catch (e) {}

// allow the server to complete any work that it would have been doing before asserting that fetch did not get called
// this 500ms timeout is brittle as it's directly tied to the simulated work in the endpoint 10 iterations of 25ms
// to see the effects of this test, you could remove the request handlers use of `req.abortSignal`
//
// this 500ms timeout is brittle as it's intended to be larger than the simulated work in the endpoint (10 iterations of 25ms)
// given this is just for demonstration purposed, it's fine
await new Promise((r) => setTimeout(r, 500));

Expand Down

0 comments on commit 7065708

Please sign in to comment.