diff options
author | Rich Trott <rtrott@gmail.com> | 2017-06-22 21:59:11 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-06-26 14:58:11 -0700 |
commit | 062c414f5c8733f769b8234ecbd9c12418b6cee3 (patch) | |
tree | 1703cd8d4a6aeb838d0a240cd8a0f2f864e7a260 /test/parallel/test-tls-env-extra-ca.js | |
parent | d71d7a1bc78826920f872482c256a56e3fabf0c4 (diff) | |
download | android-node-v8-062c414f5c8733f769b8234ecbd9c12418b6cee3.tar.gz android-node-v8-062c414f5c8733f769b8234ecbd9c12418b6cee3.tar.bz2 android-node-v8-062c414f5c8733f769b8234ecbd9c12418b6cee3.zip |
test: refactor test-tls-env-extra-ca
* Use `common.mustCall()` to guarantee callback invocations
* Order modules according to test writing guide
PR-URL: https://github.com/nodejs/node/pull/13886
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/parallel/test-tls-env-extra-ca.js')
-rw-r--r-- | test/parallel/test-tls-env-extra-ca.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/parallel/test-tls-env-extra-ca.js b/test/parallel/test-tls-env-extra-ca.js index 4580f1579f..e2de272184 100644 --- a/test/parallel/test-tls-env-extra-ca.js +++ b/test/parallel/test-tls-env-extra-ca.js @@ -9,18 +9,19 @@ if (!common.hasCrypto) { } const assert = require('assert'); +const fs = require('fs'); const tls = require('tls'); + const fork = require('child_process').fork; -const fs = require('fs'); if (process.env.CHILD) { const copts = { port: process.env.PORT, - checkServerIdentity: common.noop, + checkServerIdentity: common.mustCall(), }; - const client = tls.connect(copts, function() { + const client = tls.connect(copts, common.mustCall(function() { client.end('hi'); - }); + })); return; } @@ -29,10 +30,10 @@ const options = { cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), }; -const server = tls.createServer(options, function(s) { +const server = tls.createServer(options, common.mustCall(function(s) { s.end('bye'); server.close(); -}).listen(0, common.mustCall(function() { +})).listen(0, common.mustCall(function() { const env = { CHILD: 'yes', PORT: this.address().port, |