Skip to content
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

build(tests): type check integration.test.ts #413

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions packages/integration-tests/__tests__/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-env jest */
import * as cp from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import * as http from 'http';
import * as cp from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as http from 'node:http';

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

Expand Down Expand Up @@ -37,11 +37,11 @@ describe('Node host', () => {
`
);

const minVersion = '0.9.5'
const nvimInfo = findNvim({ minVersion: minVersion });
const minVersion = '0.9.5';
const nvimInfo = findNvim({ minVersion });
const nvimPath = nvimInfo.matches[0]?.path;
if (!nvimPath) {
throw new Error(`nvim ${minVersion} not found`)
throw new Error(`nvim ${minVersion} not found`);
}

cp.spawnSync(nvimPath, args);
Expand Down Expand Up @@ -115,10 +115,10 @@ describe('Node host', () => {
const childHost = cp.spawn(
process.execPath,
[path.join(__dirname, '..', '..', 'neovim', 'bin', 'cli.js')],
{ env: { NVIM_NODE_HOST_DEBUG: 1 }, stdio: 'ignore' }
{ env: { NVIM_NODE_HOST_DEBUG: 'TRUE' }, stdio: 'ignore' }
);

setTimeout(function () {
setTimeout(() => {
http.get('http://127.0.0.1:9229/json/list', res => {
let rawData = '';
res.on('data', chunk => {
Expand All @@ -133,7 +133,8 @@ describe('Node host', () => {
'ws://127.0.0.1:9229'
);
done();
} catch (e) {
} catch (e: any) {
// eslint-disable-next-line no-console
console.error(e.message);
throw e;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@
"jest": "^29.7.0",
"jest-haste-map": "^29.7.0",
"jest-resolve": "^29.6.1"
},
"jest": {
"testEnvironment": "node",
"testPathIgnorePatterns": [".d.ts", ".js"]
}
}
4 changes: 2 additions & 2 deletions packages/integration-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"compilerOptions": {
"outDir": "./lib"
},
"include": ["src"],
"exclude": ["node_modules", "__tests__", "**/*.test.ts", "examples", "lib"]
"include": ["src", "__tests__"],
"exclude": ["node_modules", "examples", "lib"]
}