test: refactor parallel/test-tls-addca
PR-URL: https://github.com/nodejs/node/pull/18798 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
c86fe511f4
commit
181209c3bd
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
const common = require('../common');
|
||||||
const fixtures = require('../common/fixtures');
|
const fixtures = require('../common/fixtures');
|
||||||
|
|
||||||
// Adding a CA certificate to contextWithCert should not also add it to
|
// Adding a CA certificate to contextWithCert should not also add it to
|
||||||
@ -32,7 +32,7 @@ clientOptions.secureContext = contextWithoutCert;
|
|||||||
connect({
|
connect({
|
||||||
client: clientOptions,
|
client: clientOptions,
|
||||||
server: serverOptions,
|
server: serverOptions,
|
||||||
}, function(err, pair, cleanup) {
|
}, common.mustCall((err, pair, cleanup) => {
|
||||||
assert(err);
|
assert(err);
|
||||||
assert.strictEqual(err.message, 'unable to verify the first certificate');
|
assert.strictEqual(err.message, 'unable to verify the first certificate');
|
||||||
cleanup();
|
cleanup();
|
||||||
@ -43,8 +43,8 @@ connect({
|
|||||||
connect({
|
connect({
|
||||||
client: clientOptions,
|
client: clientOptions,
|
||||||
server: serverOptions,
|
server: serverOptions,
|
||||||
}, function(err, pair, cleanup) {
|
}, common.mustCall((err, pair, cleanup) => {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
cleanup();
|
cleanup();
|
||||||
});
|
}));
|
||||||
});
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user