1
1
/* eslint-env jest */
2
- import * as cp from 'child_process' ;
3
- import * as fs from 'fs' ;
4
- import * as path from 'path' ;
5
- import * as http from 'http' ;
2
+ import * as cp from 'node: child_process' ;
3
+ import * as fs from 'node: fs' ;
4
+ import * as path from 'node: path' ;
5
+ import * as http from 'node: http' ;
6
6
7
7
import { NeovimClient , attach , findNvim } from 'neovim' ;
8
8
@@ -37,11 +37,11 @@ describe('Node host', () => {
37
37
`
38
38
) ;
39
39
40
- const minVersion = '0.9.5'
41
- const nvimInfo = findNvim ( { minVersion : minVersion } ) ;
40
+ const minVersion = '0.9.5' ;
41
+ const nvimInfo = findNvim ( { minVersion } ) ;
42
42
const nvimPath = nvimInfo . matches [ 0 ] ?. path ;
43
43
if ( ! nvimPath ) {
44
- throw new Error ( `nvim ${ minVersion } not found` )
44
+ throw new Error ( `nvim ${ minVersion } not found` ) ;
45
45
}
46
46
47
47
cp . spawnSync ( nvimPath , args ) ;
@@ -115,10 +115,10 @@ describe('Node host', () => {
115
115
const childHost = cp . spawn (
116
116
process . execPath ,
117
117
[ path . join ( __dirname , '..' , '..' , 'neovim' , 'bin' , 'cli.js' ) ] ,
118
- { env : { NVIM_NODE_HOST_DEBUG : 1 } , stdio : 'ignore' }
118
+ { env : { NVIM_NODE_HOST_DEBUG : 'TRUE' } , stdio : 'ignore' }
119
119
) ;
120
120
121
- setTimeout ( function ( ) {
121
+ setTimeout ( ( ) => {
122
122
http . get ( 'http://127.0.0.1:9229/json/list' , res => {
123
123
let rawData = '' ;
124
124
res . on ( 'data' , chunk => {
@@ -133,7 +133,8 @@ describe('Node host', () => {
133
133
'ws://127.0.0.1:9229'
134
134
) ;
135
135
done ( ) ;
136
- } catch ( e ) {
136
+ } catch ( e : any ) {
137
+ // eslint-disable-next-line no-console
137
138
console . error ( e . message ) ;
138
139
throw e ;
139
140
}
0 commit comments