Skip to content

Commit 29ddaeb

Browse files
authored
Apply suggestion from @samayer12
1 parent 78d583d commit 29ddaeb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

docs/docs/best-practices/writing-tests.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ test('example with disconnect guard', async (t) => {
4646
```
4747

4848
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:
49+
client is already closing or destroyed. Skip the guard for tests where a disconnect is expected behavior, such as:
5450

5551
- Signal aborts (`signal.emit('abort')`, `ac.abort()`)
5652
- Server-side destruction (`res.destroy()`, `req.socket.destroy()`)

0 commit comments

Comments
 (0)