We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78d583d commit 29ddaebCopy full SHA for 29ddaeb
1 file changed
docs/docs/best-practices/writing-tests.md
@@ -46,11 +46,7 @@ test('example with disconnect guard', async (t) => {
46
```
47
48
The guard listens for `'disconnect'` events and calls `t.fail()` unless the
49
-client is already closing or destroyed. `client.close()` and `client.destroy()`
50
-both emit `'disconnect'` events, but those are expected — the guard skips them
51
-by checking `!client.closed && !client.destroyed`.
52
-
53
-Skip the guard for tests where a disconnect is expected behavior, such as:
+client is already closing or destroyed. Skip the guard for tests where a disconnect is expected behavior, such as:
54
55
- Signal aborts (`signal.emit('abort')`, `ac.abort()`)
56
- Server-side destruction (`res.destroy()`, `req.socket.destroy()`)
0 commit comments