Skip to content

Commit a90c36e

Browse files
committed
test: wrap callbacks in common.must[Not]Call
1 parent 59c51c2 commit a90c36e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const common = require('../common');
66
// This certificate´s keyUsage does not include the keyCertSign
77
// bit, which used to crash node. The test ensures node
88
// will not crash. Key and certificate are from #37889.
9-
// Note: This test only cares about wether node will crash or not,
10-
// not about the success of the connection.
9+
// Note: This test assumes that the connection will succeed.
1110

1211
if (!common.hasCrypto)
1312
common.skip('missing crypto');
@@ -82,12 +81,12 @@ httpsServer.on('listening', () => {
8281
ca: cert
8382
};
8483
// Try to connect
85-
const req = https.request(clientOptions, (res) => {
84+
const req = https.request(clientOptions, common.mustCall((res) => {
8685
httpsServer.close();
87-
});
86+
}));
8887

89-
req.on('error', (e) => {
88+
req.on('error', common.mustNotCall((e) => {
9089
httpsServer.close();
91-
});
90+
}));
9291
req.end();
9392
});

0 commit comments

Comments
 (0)