mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode:Opus 4.6 PR-URL: https://github.com/nodejs/node/pull/62876 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Robert Nagy <ronagy@icloud.com>
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
// Flags: --experimental-quic
|
|
import { hasQuic, isAIX, isIBMi, isWindows, skip } from '../common/index.mjs';
|
|
import assert from 'node:assert';
|
|
import { existsSync } from 'node:fs';
|
|
import { resolve } from 'node:path';
|
|
|
|
if (!hasQuic) {
|
|
skip('QUIC support is not enabled');
|
|
}
|
|
if (isAIX) {
|
|
// AIX does not support some of the networking features used in the ngtcp2
|
|
// example server and client.
|
|
skip('QUIC third-party tests are disabled on AIX');
|
|
}
|
|
if (isIBMi) {
|
|
// IBM i does not support some of the networking features used in the ngtcp2
|
|
// example server and client.
|
|
skip('QUIC third-party tests are disabled on IBM i');
|
|
}
|
|
if (isWindows) {
|
|
// Windows does not support the [Li/U]nix specific headers and system calls
|
|
// required by the ngtcp2 example server/client.
|
|
skip('QUIC third-party tests are disabled on Windows');
|
|
}
|
|
if (!existsSync(resolve(process.execPath, '../ngtcp2_test_client'))) {
|
|
skip('ngtcp2_test_client binary not built');
|
|
}
|
|
|
|
const { default: QuicTestClient } = await import('../common/quic/test-client.mjs');
|
|
|
|
const client = new QuicTestClient();
|
|
|
|
// If this completes without throwing, the test passes.
|
|
await client.help({ stdio: 'ignore' });
|
|
|
|
setTimeout(() => {
|
|
client.stop();
|
|
}, 100);
|
|
|
|
// We expect this to fail since there's no server running.
|
|
await assert.rejects(client.run('localhost', '12345', undefined, { stdio: 'ignore' }),
|
|
{ message: /Process exited with code 1 and signal null/ });
|