| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent abce850 commit 582e88a
234 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | import fixtures from './fixtures.js'; | |
| 2 | 2 | ||
| 3 | + // eslint-disable-next-line no-restricted-syntax | ||
| 3 | 4 | const { | |
| 4 | 5 | fixturesDir, | |
| 5 | 6 | path, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -117,6 +117,10 @@ export default [ | |||
| 117 | 117 | selector: 'CallExpression:matches([callee.type="Identifier"][callee.name="assert"], [callee.type="MemberExpression"][callee.object.type="Identifier"][callee.object.name="assert"][callee.property.type="Identifier"][callee.property.name="ok"])[arguments.0.type="UnaryExpression"][arguments.0.operator="!"][arguments.0.argument.type="CallExpression"][arguments.0.argument.callee.type="MemberExpression"][arguments.0.argument.callee.object.regex][arguments.0.argument.callee.property.name="test"]', | |
| 118 | 118 | message: 'Use assert.doesNotMatch instead', | |
| 119 | 119 | }, | |
| 120 | + { | ||
| 121 | + selector: 'VariableDeclarator[init.type="Identifier"][init.name=/^(assert|fixtures)$/]', | ||
| 122 | + message: 'Do not destructure or rename `assert` nor `fixtures`', | ||
| 123 | + }, | ||
| 120 | 124 | ...((fixturesSpecifier) => [ | |
| 121 | 125 | { | |
| 122 | 126 | selector: `ImportDeclaration[source.value=${fixturesSpecifier.toString().replace('(\\.js)?', '\\.mjs')}]:not(${[ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ const { mustCall, hasCrypto } = require('../common'); | |||
| 4 | 4 | const assert = require('assert'); | |
| 5 | 5 | const util = require('util'); | |
| 6 | 6 | const { test } = require('node:test'); | |
| 7 | - const { AssertionError } = assert; | ||
| 8 | 7 | const defaultMsgStart = 'Expected values to be strictly deep-equal:\n'; | |
| 9 | 8 | const defaultMsgStartFull = `${defaultMsgStart}+ actual - expected`; | |
| 10 | 9 | ||
@@ -688,11 +687,11 @@ test('Handle sparse arrays', () => { | |||
| 688 | 687 | const b = new Array(3); | |
| 689 | 688 | a[2] = true; | |
| 690 | 689 | b[1] = true; | |
| 691 | - assertNotDeepOrStrict(a, b, AssertionError, { partial: 'pass' }); | ||
| 690 | + assertNotDeepOrStrict(a, b, assert.AssertionError, { partial: 'pass' }); | ||
| 692 | 691 | b[2] = true; | |
| 693 | 692 | assertNotDeepOrStrict(a, b); | |
| 694 | 693 | a[0] = true; | |
| 695 | - assertNotDeepOrStrict(a, b, AssertionError, { partial: 'pass' }); | ||
| 694 | + assertNotDeepOrStrict(a, b, assert.AssertionError, { partial: 'pass' }); | ||
| 696 | 695 | }); | |
| 697 | 696 | ||
| 698 | 697 | test('Handle sets and maps with mixed keys', () => { | |
@@ -715,7 +714,7 @@ test('Handle different error messages', () => { | |||
| 715 | 714 | assertNotDeepOrStrict(err1, new Error('foo2'), assert.AssertionError); | |
| 716 | 715 | assertNotDeepOrStrict(err1, new TypeError('foo1'), assert.AssertionError); | |
| 717 | 716 | assertDeepAndStrictEqual(err1, new Error('foo1')); | |
| 718 | - assertNotDeepOrStrict(err1, {}, AssertionError); | ||
| 717 | + assertNotDeepOrStrict(err1, {}, assert.AssertionError); | ||
| 719 | 718 | }); | |
| 720 | 719 | ||
| 721 | 720 | test('Handle NaN', () => { | |
@@ -811,18 +810,18 @@ test('Additional tests', () => { | |||
| 811 | 810 | assertDeepAndStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14)); | |
| 812 | 811 | ||
| 813 | 812 | assert.throws(() => { assert.deepEqual(new Date(), new Date(2000, 3, 14)); }, | |
| 814 | - AssertionError, | ||
| 813 | + assert.AssertionError, | ||
| 815 | 814 | 'deepEqual(new Date(), new Date(2000, 3, 14))'); | |
| 816 | 815 | ||
| 817 | 816 | assert.throws( | |
| 818 | 817 | () => { assert.notDeepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14)); }, | |
| 819 | - AssertionError, | ||
| 818 | + assert.AssertionError, | ||
| 820 | 819 | 'notDeepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))' | |
| 821 | 820 | ); | |
| 822 | 821 | ||
| 823 | 822 | assert.throws( | |
| 824 | 823 | () => { assert.notDeepEqual('a'.repeat(1024), 'a'.repeat(1024)); }, | |
| 825 | - AssertionError, | ||
| 824 | + assert.AssertionError, | ||
| 826 | 825 | 'notDeepEqual("a".repeat(1024), "a".repeat(1024))' | |
| 827 | 826 | ); | |
| 828 | 827 | ||
@@ -861,7 +860,7 @@ test('Additional tests', () => { | |||
| 861 | 860 | assert.deepEqual(4, '4'); | |
| 862 | 861 | assert.deepEqual(true, 1); | |
| 863 | 862 | assert.throws(() => assert.deepEqual(4, '5'), | |
| 864 | - AssertionError, | ||
| 863 | + assert.AssertionError, | ||
| 865 | 864 | 'deepEqual( 4, \'5\')'); | |
| 866 | 865 | }); | |
| 867 | 866 | ||
@@ -870,7 +869,7 @@ test('Having the same number of owned properties && the same set of keys', () => | |||
| 870 | 869 | assert.deepEqual({ a: 4, b: '2' }, { a: 4, b: '2' }); | |
| 871 | 870 | assert.deepEqual([4], ['4']); | |
| 872 | 871 | assert.throws( | |
| 873 | - () => assert.deepEqual({ a: 4 }, { a: 4, b: true }), AssertionError); | ||
| 872 | + () => assert.deepEqual({ a: 4 }, { a: 4, b: true }), assert.AssertionError); | ||
| 874 | 873 | assert.notDeepEqual(['a'], { 0: 'a' }); | |
| 875 | 874 | assert.deepEqual({ a: 4, b: '1' }, { b: '1', a: 4 }); | |
| 876 | 875 | const a1 = [1, 2, 3]; | |
@@ -880,7 +879,7 @@ test('Having the same number of owned properties && the same set of keys', () => | |||
| 880 | 879 | a2.b = true; | |
| 881 | 880 | a2.a = 'test'; | |
| 882 | 881 | assert.throws(() => assert.deepEqual(Object.keys(a1), Object.keys(a2)), | |
| 883 | - AssertionError); | ||
| 882 | + assert.AssertionError); | ||
| 884 | 883 | assertDeepAndStrictEqual(a1, a2); | |
| 885 | 884 | }); | |
| 886 | 885 | ||
@@ -946,7 +945,7 @@ test('Additional tests', () => { | |||
| 946 | 945 | ||
| 947 | 946 | assert.throws( | |
| 948 | 947 | () => assert.deepStrictEqual(new Date(), new Date(2000, 3, 14)), | |
| 949 | - AssertionError, | ||
| 948 | + assert.AssertionError, | ||
| 950 | 949 | 'deepStrictEqual(new Date(), new Date(2000, 3, 14))' | |
| 951 | 950 | ); | |
| 952 | 951 | ||
@@ -1059,7 +1058,7 @@ test('Additional tests', () => { | |||
| 1059 | 1058 | ||
| 1060 | 1059 | assert.throws( | |
| 1061 | 1060 | () => assert.deepStrictEqual([0, 1, 2, 'a', 'b'], [0, 1, 2, 'b', 'a']), | |
| 1062 | - AssertionError); | ||
| 1061 | + assert.AssertionError); | ||
| 1063 | 1062 | }); | |
| 1064 | 1063 | ||
| 1065 | 1064 | test('Having the same number of owned properties && the same set of keys', () => { | |
@@ -1105,7 +1104,7 @@ test('Prototype check', () => { | |||
| 1105 | 1104 | const obj1 = new Constructor1('Ryan', 'Dahl'); | |
| 1106 | 1105 | let obj2 = new Constructor2('Ryan', 'Dahl'); | |
| 1107 | 1106 | ||
| 1108 | - assert.throws(() => assert.deepStrictEqual(obj1, obj2), AssertionError); | ||
| 1107 | + assert.throws(() => assert.deepStrictEqual(obj1, obj2), assert.AssertionError); | ||
| 1109 | 1108 | ||
| 1110 | 1109 | Constructor2.prototype = Constructor1.prototype; | |
| 1111 | 1110 | obj2 = new Constructor2('Ryan', 'Dahl'); | |
@@ -1262,7 +1261,7 @@ test('Verify that changed tags will still check for the error message', () => { | |||
| 1262 | 1261 | err[Symbol.toStringTag] = 'Foobar'; | |
| 1263 | 1262 | const err2 = new Error('bar'); | |
| 1264 | 1263 | err2[Symbol.toStringTag] = 'Foobar'; | |
| 1265 | - assertNotDeepOrStrict(err, err2, AssertionError); | ||
| 1264 | + assertNotDeepOrStrict(err, err2, assert.AssertionError); | ||
| 1266 | 1265 | }); | |
| 1267 | 1266 | ||
| 1268 | 1267 | test('Check for non-native errors', () => { | |
@@ -1281,8 +1280,8 @@ test('Check for non-native errors', () => { | |||
| 1281 | 1280 | test('Check for Errors with cause property', () => { | |
| 1282 | 1281 | const e1 = new Error('err', { cause: new Error('cause e1') }); | |
| 1283 | 1282 | const e2 = new Error('err', { cause: new Error('cause e2') }); | |
| 1284 | - assertNotDeepOrStrict(e1, e2, AssertionError); | ||
| 1285 | - assertNotDeepOrStrict(e1, new Error('err'), AssertionError); | ||
| 1283 | + assertNotDeepOrStrict(e1, e2, assert.AssertionError); | ||
| 1284 | + assertNotDeepOrStrict(e1, new Error('err'), assert.AssertionError); | ||
| 1286 | 1285 | assertDeepAndStrictEqual(e1, new Error('err', { cause: new Error('cause e1') })); | |
| 1287 | 1286 | }); | |
| 1288 | 1287 | ||
@@ -1294,8 +1293,8 @@ test('Check for AggregateError', () => { | |||
| 1294 | 1293 | const e3 = new AggregateError([e1duplicate, e2], 'Aggregate Error'); | |
| 1295 | 1294 | const e3duplicate = new AggregateError([e1, e2], 'Aggregate Error'); | |
| 1296 | 1295 | const e4 = new AggregateError([e1], 'Aggregate Error'); | |
| 1297 | - assertNotDeepOrStrict(e1, e3, AssertionError); | ||
| 1298 | - assertNotDeepOrStrict(e3, e4, AssertionError); | ||
| 1296 | + assertNotDeepOrStrict(e1, e3, assert.AssertionError); | ||
| 1297 | + assertNotDeepOrStrict(e3, e4, assert.AssertionError); | ||
| 1299 | 1298 | assertDeepAndStrictEqual(e3, e3duplicate); | |
| 1300 | 1299 | }); | |
| 1301 | 1300 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,25 +9,22 @@ import { hasQuic, skip, mustCall } from '../common/index.mjs'; | |||
| 9 | 9 | import assert from 'node:assert'; | |
| 10 | 10 | import * as fixtures from '../common/fixtures.mjs'; | |
| 11 | 11 | ||
| 12 | - const { strictEqual } = assert; | ||
| 13 | - const { readKey } = fixtures; | ||
| 14 | - | ||
| 15 | 12 | if (!hasQuic) { | |
| 16 | 13 | skip('QUIC is not enabled'); | |
| 17 | 14 | } | |
| 18 | 15 | ||
| 19 | 16 | const { listen, connect, QuicEndpoint } = await import('node:quic'); | |
| 20 | 17 | const { createPrivateKey } = await import('node:crypto'); | |
| 21 | 18 | ||
| 22 | - const key = createPrivateKey(readKey('agent1-key.pem')); | ||
| 23 | - const cert = readKey('agent1-cert.pem'); | ||
| 19 | + const key = createPrivateKey(fixtures.readKey('agent1-key.pem')); | ||
| 20 | + const cert = fixtures.readKey('agent1-cert.pem'); | ||
| 24 | 21 | ||
| 25 | 22 | const endpoint = new QuicEndpoint({ validateAddress: true }); | |
| 26 | 23 | ||
| 27 | 24 | const serverEndpoint = await listen(mustCall(async (serverSession) => { | |
| 28 | 25 | const info = await serverSession.opened; | |
| 29 | 26 | // The handshake should complete despite the Retry flow. | |
| 30 | - strictEqual(info.protocol, 'quic-test'); | ||
| 27 | + assert.strictEqual(info.protocol, 'quic-test'); | ||
| 31 | 28 | serverSession.close(); | |
| 32 | 29 | }), { | |
| 33 | 30 | endpoint, | |
@@ -42,7 +39,7 @@ const clientSession = await connect(serverEndpoint.address, { | |||
| 42 | 39 | }); | |
| 43 | 40 | ||
| 44 | 41 | const info = await clientSession.opened; | |
| 45 | - strictEqual(info.protocol, 'quic-test'); | ||
| 42 | + assert.strictEqual(info.protocol, 'quic-test'); | ||
| 46 | 43 | ||
| 47 | 44 | // The serverEndpoint must be closed after we wait for the clientSession to close. | |
| 48 | 45 | await clientSession.closed; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,18 +4,15 @@ import { hasQuic, skip, mustCall } from '../common/index.mjs'; | |||
| 4 | 4 | import assert from 'node:assert'; | |
| 5 | 5 | import * as fixtures from '../common/fixtures.mjs'; | |
| 6 | 6 | ||
| 7 | - const { strictEqual, notStrictEqual } = assert; | ||
| 8 | - const { readKey } = fixtures; | ||
| 9 | - | ||
| 10 | 7 | if (!hasQuic) { | |
| 11 | 8 | skip('QUIC is not enabled'); | |
| 12 | 9 | } | |
| 13 | 10 | ||
| 14 | 11 | const { listen, connect } = await import('node:quic'); | |
| 15 | 12 | const { createPrivateKey } = await import('node:crypto'); | |
| 16 | 13 | ||
| 17 | - const key = createPrivateKey(readKey('agent1-key.pem')); | ||
| 18 | - const cert = readKey('agent1-cert.pem'); | ||
| 14 | + const key = createPrivateKey(fixtures.readKey('agent1-key.pem')); | ||
| 15 | + const cert = fixtures.readKey('agent1-cert.pem'); | ||
| 19 | 16 | ||
| 20 | 17 | // Test h3 ALPN negotiation with Http3ApplicationImpl. | |
| 21 | 18 | // Both server and client use the default ALPN (h3). | |
@@ -24,14 +21,14 @@ const serverOpened = Promise.withResolvers(); | |||
| 24 | 21 | ||
| 25 | 22 | const serverEndpoint = await listen(mustCall(async (serverSession) => { | |
| 26 | 23 | const info = await serverSession.opened; | |
| 27 | - strictEqual(info.protocol, 'h3'); | ||
| 24 | + assert.strictEqual(info.protocol, 'h3'); | ||
| 28 | 25 | serverOpened.resolve(); | |
| 29 | 26 | serverSession.close(); | |
| 30 | 27 | }), { | |
| 31 | 28 | sni: { '*': { keys: [key], certs: [cert] } }, | |
| 32 | 29 | }); | |
| 33 | 30 | ||
| 34 | - notStrictEqual(serverEndpoint.address, undefined); | ||
| 31 | + assert.notStrictEqual(serverEndpoint.address, undefined); | ||
| 35 | 32 | ||
| 36 | 33 | const clientSession = await connect(serverEndpoint.address, { | |
| 37 | 34 | servername: 'localhost', | |
@@ -40,7 +37,7 @@ const clientSession = await connect(serverEndpoint.address, { | |||
| 40 | 37 | ||
| 41 | 38 | async function checkClient() { | |
| 42 | 39 | const info = await clientSession.opened; | |
| 43 | - strictEqual(info.protocol, 'h3'); | ||
| 40 | + assert.strictEqual(info.protocol, 'h3'); | ||
| 44 | 41 | } | |
| 45 | 42 | ||
| 46 | 43 | await Promise.all([serverOpened.promise, checkClient()]); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,11 +8,9 @@ | |||
| 8 | 8 | // 0x100 | <tls_alert>. For `no_application_protocol` (alert 120 / 0x78) this | |
| 9 | 9 | // is 0x178 == 376. | |
| 10 | 10 | ||
| 11 | - import { hasQuic, skip, mustCall, mustNotCall } from '../common/index.mjs'; | ||
| 11 | + import { hasQuic, skip, mustNotCall, expectsError } from '../common/index.mjs'; | ||
| 12 | 12 | import assert from 'node:assert'; | |
| 13 | 13 | ||
| 14 | - const { rejects, strictEqual, match } = assert; | ||
| 15 | - | ||
| 16 | 14 | if (!hasQuic) { | |
| 17 | 15 | skip('QUIC is not enabled'); | |
| 18 | 16 | } | |
@@ -25,11 +23,6 @@ const expected = { | |||
| 25 | 23 | message: /no application protocol/ | |
| 26 | 24 | }; | |
| 27 | 25 | ||
| 28 | - const onerror = mustCall((err) => { | ||
| 29 | - strictEqual(err.code, 'ERR_QUIC_TRANSPORT_ERROR'); | ||
| 30 | - strictEqual(err.errorCode, 376n); | ||
| 31 | - match(err.message, /no application protocol/); | ||
| 32 | - }); | ||
| 33 | 26 | const transportParams = { maxIdleTimeout: 1 }; | |
| 34 | 27 | ||
| 35 | 28 | // The handshake fails so the session is never surfaced to JS | |
@@ -43,12 +36,12 @@ const serverEndpoint = await listen( | |||
| 43 | 36 | const clientSession = await connect(serverEndpoint.address, { | |
| 44 | 37 | alpn: 'nonexistent-protocol', | |
| 45 | 38 | transportParams, | |
| 46 | - onerror, | ||
| 39 | + onerror: expectsError(expected), | ||
| 47 | 40 | }); | |
| 48 | 41 | ||
| 49 | - await rejects(clientSession.opened, expected); | ||
| 42 | + await assert.rejects(clientSession.opened, expected); | ||
| 50 | 43 | ||
| 51 | 44 | // The handshake should fail — opened may reject or never resolve. | |
| 52 | 45 | // The session should close with an error. | |
| 53 | - await rejects(clientSession.closed, expected); | ||
| 46 | + await assert.rejects(clientSession.closed, expected); | ||
| 54 | 47 | await serverEndpoint.close(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,18 +4,15 @@ import { hasQuic, skip, mustCall } from '../common/index.mjs'; | |||
| 4 | 4 | import assert from 'node:assert'; | |
| 5 | 5 | import * as fixtures from '../common/fixtures.mjs'; | |
| 6 | 6 | ||
| 7 | - const { notStrictEqual, strictEqual } = assert; | ||
| 8 | - const { readKey } = fixtures; | ||
| 9 | - | ||
| 10 | 7 | if (!hasQuic) { | |
| 11 | 8 | skip('QUIC is not enabled'); | |
| 12 | 9 | } | |
| 13 | 10 | ||
| 14 | 11 | const { listen, connect } = await import('node:quic'); | |
| 15 | 12 | const { createPrivateKey } = await import('node:crypto'); | |
| 16 | 13 | ||
| 17 | - const key = createPrivateKey(readKey('agent1-key.pem')); | ||
| 18 | - const cert = readKey('agent1-cert.pem'); | ||
| 14 | + const key = createPrivateKey(fixtures.readKey('agent1-key.pem')); | ||
| 15 | + const cert = fixtures.readKey('agent1-cert.pem'); | ||
| 19 | 16 | ||
| 20 | 17 | // Server offers multiple ALPNs. Client requests one that the server supports. | |
| 21 | 18 | // Verify the negotiated protocol matches on both sides. | |
@@ -25,7 +22,7 @@ const serverOpened = Promise.withResolvers(); | |||
| 25 | 22 | async function checkSession(session) { | |
| 26 | 23 | const info = await session.opened; | |
| 27 | 24 | // The client should negotiate proto-b (the only protocol it requested) | |
| 28 | - strictEqual(info.protocol, 'proto-b'); | ||
| 25 | + assert.strictEqual(info.protocol, 'proto-b'); | ||
| 29 | 26 | } | |
| 30 | 27 | ||
| 31 | 28 | const serverEndpoint = await listen(mustCall(async (serverSession) => { | |
@@ -36,7 +33,7 @@ const serverEndpoint = await listen(mustCall(async (serverSession) => { | |||
| 36 | 33 | alpn: ['proto-a', 'proto-b', 'proto-c'], | |
| 37 | 34 | }); | |
| 38 | 35 | ||
| 39 | - notStrictEqual(serverEndpoint.address, undefined); | ||
| 36 | + assert.notStrictEqual(serverEndpoint.address, undefined); | ||
| 40 | 37 | ||
| 41 | 38 | const clientSession = await connect(serverEndpoint.address, { | |
| 42 | 39 | alpn: 'proto-b', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,8 +8,6 @@ import { hasQuic, skip, mustCall, mustNotCall } from '../common/index.mjs'; | |||
| 8 | 8 | import assert from 'node:assert'; | |
| 9 | 9 | import net from 'node:net'; | |
| 10 | 10 | ||
| 11 | - const { ok, rejects, strictEqual } = assert; | ||
| 12 | - | ||
| 13 | 11 | if (!hasQuic) { | |
| 14 | 12 | skip('QUIC is not enabled'); | |
| 15 | 13 | } | |
@@ -34,18 +32,18 @@ const { listen, connect } = await import('../common/quic.mjs'); | |||
| 34 | 32 | handshakeTimeout: 500, | |
| 35 | 33 | verifyPeer: 'manual', | |
| 36 | 34 | onerror: mustCall((err) => { | |
| 37 | - strictEqual(err.code, 'ERR_QUIC_TRANSPORT_ERROR'); | ||
| 35 | + assert.strictEqual(err.code, 'ERR_QUIC_TRANSPORT_ERROR'); | ||
| 38 | 36 | }), | |
| 39 | 37 | }); | |
| 40 | 38 | ||
| 41 | 39 | // The session should fail — the server never sees the packet. | |
| 42 | - await rejects(clientSession.opened, { | ||
| 40 | + await assert.rejects(clientSession.opened, { | ||
| 43 | 41 | code: 'ERR_QUIC_TRANSPORT_ERROR', | |
| 44 | 42 | }); | |
| 45 | 43 | ||
| 46 | 44 | // Verify the stat counter. | |
| 47 | - ok(serverEndpoint.stats.packetsBlocked > 0n, | ||
| 48 | - 'packetsBlocked should be non-zero'); | ||
| 45 | + assert.ok(serverEndpoint.stats.packetsBlocked > 0n, | ||
| 46 | + 'packetsBlocked should be non-zero'); | ||
| 49 | 47 | ||
| 50 | 48 | await serverEndpoint.close(); | |
| 51 | 49 | } | |
@@ -72,8 +70,7 @@ const { listen, connect } = await import('../common/quic.mjs'); | |||
| 72 | 70 | await clientSession.opened; | |
| 73 | 71 | await clientSession.close(); | |
| 74 | 72 | ||
| 75 | - strictEqual(serverEndpoint.stats.packetsBlocked, 0n, | ||
| 76 | - 'No packets should be blocked for allowed address'); | ||
| 73 | + assert.strictEqual(serverEndpoint.stats.packetsBlocked, 0n); // No packets should be blocked for allowed address | ||
| 77 | 74 | ||
| 78 | 75 | await serverEndpoint.close(); | |
| 79 | 76 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,8 +7,6 @@ | |||
| 7 | 7 | import { hasQuic, skip, mustCall } from '../common/index.mjs'; | |
| 8 | 8 | import assert from 'node:assert'; | |
| 9 | 9 | ||
| 10 | - const { rejects } = assert; | ||
| 11 | - | ||
| 12 | 10 | if (!hasQuic) { | |
| 13 | 11 | skip('QUIC is not enabled'); | |
| 14 | 12 | } | |
@@ -42,5 +40,5 @@ stream.onblocked = mustCall(() => { | |||
| 42 | 40 | stream.setBody(new Uint8Array(4096)); | |
| 43 | 41 | ||
| 44 | 42 | // The stream's closed promise should reject with the error from the throw. | |
| 45 | - await rejects(stream.closed, testError); | ||
| 43 | + await assert.rejects(stream.closed, testError); | ||
| 46 | 44 | await serverEndpoint.close(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments