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 6ae98c7 commit c9a3dd0Copy full SHA for c9a3dd0
src/attach.test.js
@@ -39,6 +39,12 @@ describe('Nvim Promise API', () => {
39
done();
40
});
41
42
+ afterAll(() => {
43
+ if (proc) {
44
+ proc.kill();
45
+ }
46
+ });
47
+
48
beforeEach(() => {
49
requests = [];
50
notifications = [];
@@ -96,8 +102,15 @@ describe('Nvim Promise API', () => {
96
102
97
103
98
104
it('emits "disconnect" after quit', done => {
99
- nvim.on('disconnect', done);
105
+ const disconnectMock = jest.fn();
106
+ nvim.on('disconnect', disconnectMock);
100
107
nvim.quit();
108
109
+ proc.on('close', () => {
110
+ expect(disconnectMock.mock.calls.length).toBe(1);
111
+ done();
112
113
101
114
// Event doesn't actually emit when we quit nvim, but when the child process is killed
115
proc.kill();
116
0 commit comments