Skip to content

Commit e28b0c6

Browse files
authored
build(tests): type check integration.test.ts #413
* Avoid jest runs on js files
1 parent a7d6c78 commit e28b0c6

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

packages/integration-tests/__tests__/integration.test.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* 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';
66

77
import { NeovimClient, attach, findNvim } from 'neovim';
88

@@ -37,11 +37,11 @@ describe('Node host', () => {
3737
`
3838
);
3939

40-
const minVersion = '0.9.5'
41-
const nvimInfo = findNvim({ minVersion: minVersion });
40+
const minVersion = '0.9.5';
41+
const nvimInfo = findNvim({ minVersion });
4242
const nvimPath = nvimInfo.matches[0]?.path;
4343
if (!nvimPath) {
44-
throw new Error(`nvim ${minVersion} not found`)
44+
throw new Error(`nvim ${minVersion} not found`);
4545
}
4646

4747
cp.spawnSync(nvimPath, args);
@@ -115,10 +115,10 @@ describe('Node host', () => {
115115
const childHost = cp.spawn(
116116
process.execPath,
117117
[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' }
119119
);
120120

121-
setTimeout(function () {
121+
setTimeout(() => {
122122
http.get('http://127.0.0.1:9229/json/list', res => {
123123
let rawData = '';
124124
res.on('data', chunk => {
@@ -133,7 +133,8 @@ describe('Node host', () => {
133133
'ws://127.0.0.1:9229'
134134
);
135135
done();
136-
} catch (e) {
136+
} catch (e: any) {
137+
// eslint-disable-next-line no-console
137138
console.error(e.message);
138139
throw e;
139140
}

packages/integration-tests/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,9 @@
5353
"jest": "^29.7.0",
5454
"jest-haste-map": "^29.7.0",
5555
"jest-resolve": "^29.6.1"
56+
},
57+
"jest": {
58+
"testEnvironment": "node",
59+
"testPathIgnorePatterns": [".d.ts", ".js"]
5660
}
5761
}

packages/integration-tests/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"compilerOptions": {
44
"outDir": "./lib"
55
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "__tests__", "**/*.test.ts", "examples", "lib"]
6+
"include": ["src", "__tests__"],
7+
"exclude": ["node_modules", "examples", "lib"]
88
}

0 commit comments

Comments
 (0)