-
Notifications
You must be signed in to change notification settings - Fork 54
test(attach): improve disconnect test #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,10 +157,12 @@ describe('Nvim API', () => { | |
it('emits "disconnect" after quit', done => { | ||
const disconnectMock = jest.fn(); | ||
nvim.on('disconnect', disconnectMock); | ||
|
||
nvim.quit(); | ||
|
||
proc.on('close', () => { | ||
expect(disconnectMock.mock.calls.length).toBe(1); | ||
// TODO: 'close' event sometimes does not emit. #414 | ||
proc.on('exit', () => { | ||
expect(disconnectMock).toHaveBeenCalledTimes(1); | ||
done(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since the test is timing out, that means this This proc.on was added in c9a3dd0 for some reason. But later the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I understand that, but how race could happen to cause this problem? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need the disconnect call on proc ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, that causes the test harness (jest) to kill Nvim too early, which then raises EPIPE because Nvim still has messages to process. |
||
}); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.