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

test: run test on Node.js 22 #507

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 1 addition & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ jobs:
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest, macos-latest, windows-latest'
version: '14.19.3, 14, 16, 18, 20, 21'
install: 'npx npminstall'
version: '14.19.3, 14, 16, 18, 20, 22'
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('index.test.ts', () => {
assert.equal(response.url, `${_url}html`);
assert(!response.redirected);
assert.equal(getDefaultHttpClient(), getDefaultHttpClient());
console.log('stats %o', getDefaultHttpClient().getDispatcherPoolStats());
// console.log('stats %o', getDefaultHttpClient().getDispatcherPoolStats());
});
});

Expand Down Expand Up @@ -76,7 +76,7 @@ describe('index.test.ts', () => {
dataType: 'json',
});
assert.equal(response.status, 200);
console.log(response.data.hello);
// console.log(response.data.hello);
});

it('should curl alias to request', async () => {
Expand Down
8 changes: 4 additions & 4 deletions test/keep-alive-header.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('keep-alive-header.test.ts', () => {
count++;
try {
const task = httpClient.request(_url);
console.log('after request stats: %o', httpClient.getDispatcherPoolStats());
// console.log('after request stats: %o', httpClient.getDispatcherPoolStats());
if (httpClient.getDispatcherPoolStats()[origin]) {
if (!(nodeMajorVersion() === 14 || isWindows())) {
// ignore node = 14 & windows
Expand All @@ -40,7 +40,7 @@ describe('keep-alive-header.test.ts', () => {
}
}
let response = await task;
console.log('after response stats: %o', httpClient.getDispatcherPoolStats());
// console.log('after response stats: %o', httpClient.getDispatcherPoolStats());
assert.equal(httpClient.getDispatcherPoolStats()[origin].pending, 0);
assert.equal(httpClient.getDispatcherPoolStats()[origin].connected, 1);
// console.log(response.res.socket);
Expand Down Expand Up @@ -129,12 +129,12 @@ describe('keep-alive-header.test.ts', () => {
assert.equal(response.headers.connection, 'keep-alive');
assert.equal(response.headers['keep-alive'], 'timeout=2');
assert(parseInt(response.headers['x-requests-persocket'] as string) > 1);
console.log('before sleep stats: %o', httpClient.getDispatcherPoolStats());
// console.log('before sleep stats: %o', httpClient.getDispatcherPoolStats());
// { connected: 2, free: 1, pending: 0, queued: 0, running: 0, size: 0 }
assert.equal(httpClient.getDispatcherPoolStats()[origin].connected, 2);
assert.equal(httpClient.getDispatcherPoolStats()[origin].free, 1);
await sleep(keepAliveTimeout);
console.log('after sleep stats: %o', httpClient.getDispatcherPoolStats());
// console.log('after sleep stats: %o', httpClient.getDispatcherPoolStats());
// clients maybe all gone => after sleep stats: {}
// { connected: 0, free: 0, pending: 0, queued: 0, running: 0, size: 0 }
// { connected: 1, free: 1, pending: 0, queued: 0, running: 0, size: 0 }
Expand Down
Loading