Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 99b2369

Browse filesBrowse files
anonrigaduh95
authored andcommitted
test: simplify test-tls-connect-abort-controller.js
PR-URL: #57338 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2fbd3bb commit 99b2369
Copy full SHA for 99b2369

File tree

Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-tls-connect-abort-controller.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-connect-abort-controller.js
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ server.listen(0, common.mustCall(async () => {
2323
rejectUnauthorized: false,
2424
});
2525

26-
const assertAbort = async (socket, testName) => {
27-
try {
28-
await once(socket, 'close');
29-
assert.fail(`close ${testName} should have thrown`);
30-
} catch (err) {
31-
assert.strictEqual(err.name, 'AbortError');
32-
}
33-
};
26+
function assertAbort(socket, testName) {
27+
return assert.rejects(() => once(socket, 'close'), {
28+
name: 'AbortError',
29+
}, `close ${testName} should have thrown`);
30+
}
3431

3532
async function postAbort() {
3633
const ac = new AbortController();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.