mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
test: simplify test-tls-connect-abort-controller.js
PR-URL: https://github.com/nodejs/node/pull/57338 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
abd73d865a
commit
2eea453745
|
|
@ -23,14 +23,11 @@ server.listen(0, common.mustCall(async () => {
|
|||
rejectUnauthorized: false,
|
||||
});
|
||||
|
||||
const assertAbort = async (socket, testName) => {
|
||||
try {
|
||||
await once(socket, 'close');
|
||||
assert.fail(`close ${testName} should have thrown`);
|
||||
} catch (err) {
|
||||
assert.strictEqual(err.name, 'AbortError');
|
||||
}
|
||||
};
|
||||
function assertAbort(socket, testName) {
|
||||
return assert.rejects(() => once(socket, 'close'), {
|
||||
name: 'AbortError',
|
||||
}, `close ${testName} should have thrown`);
|
||||
}
|
||||
|
||||
async function postAbort() {
|
||||
const ac = new AbortController();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user