@@ -2,12 +2,23 @@ import * as jestMock from 'jest-mock';
22import expect from 'expect' ;
33import { attach } from './attach' ;
44import { Logger } from '../utils/logger' ;
5- import { proc , nvim , startNvim , stopNvim } from '../testUtil' ;
5+ import * as testUtil from '../testUtil' ;
66import { NeovimClient } from '../api/client' ;
77
88// global.expect = expect;
99
1010describe ( 'Nvim API' , ( ) => {
11+ let proc : ReturnType < typeof testUtil . startNvim > [ 0 ] ;
12+ let nvim : ReturnType < typeof testUtil . startNvim > [ 1 ] ;
13+
14+ before ( async ( ) => {
15+ [ proc , nvim ] = testUtil . startNvim ( ) ;
16+ } ) ;
17+
18+ after ( ( ) => {
19+ testUtil . stopNvim ( ) ;
20+ } ) ;
21+
1122 let requests : { method : string ; args : number [ ] } [ ] ;
1223 let notifications : { method : string ; args : number [ ] } [ ] ;
1324
@@ -54,7 +65,7 @@ describe('Nvim API', () => {
5465 } ) ;
5566
5667 it ( 'console.log NOT monkey-patched if custom logger passed to attach()' , async ( ) => {
57- const [ proc2 ] = startNvim ( false ) ;
68+ const [ proc2 ] = testUtil . startNvim ( false ) ;
5869 const logged : string [ ] = [ ] ;
5970 let logger2 = { } ;
6071 const fakeLog = ( msg : any ) => {
@@ -87,7 +98,7 @@ describe('Nvim API', () => {
8798 // Still alive?
8899 expect ( await nvim2 . eval ( '1+1' ) ) . toEqual ( 2 ) ;
89100
90- stopNvim ( nvim2 ) ;
101+ testUtil . stopNvim ( nvim2 ) ;
91102 } ) ;
92103
93104 it ( 'can send requests and receive response' , async ( ) => {
0 commit comments