Commit 0909033
authored
test(attach): fix "emits disconnect" timeout #414
Problem:
This test may time out, because the `proc.on('close')` event is never triggered.
FAIL src/attach/attach.test.ts (5.62 s)
● Nvim API › emits "disconnect" after quit
thrown: "Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.
| });
|
> | it('emits "disconnect" after quit', done => {
| ^
| const disconnectMock = jest.fn();
| nvim.on('disconnect', disconnectMock);
| nvim.quit();
at it (src/attach/attach.test.ts:138:3)
at Object.describe (src/attach/attach.test.ts:6:1)
Solution:
Listen for 'exit' instead of 'close'. This may indicate that Nvim or node-client
is not properly closing all of its streams, but that is unrelated to this
particular test.1 parent e28b0c6 commit 0909033
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
0 commit comments