diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-06-30 20:52:53 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-07-04 04:04:49 +0300 |
commit | cc1a47dc6b94b2feb4de9e46be9333d81d537783 (patch) | |
tree | c1d09cecb958b653999040212137cf52cf03f960 /test/parallel/test-tls-server-verify.js | |
parent | f1c890afb05274880df0f1ce4084607c03b194bf (diff) | |
download | android-node-v8-cc1a47dc6b94b2feb4de9e46be9333d81d537783.tar.gz android-node-v8-cc1a47dc6b94b2feb4de9e46be9333d81d537783.tar.bz2 android-node-v8-cc1a47dc6b94b2feb4de9e46be9333d81d537783.zip |
test: fix require nits in some test-tls-* tests
* Do not require if test is skipped.
* Do not re-require without need.
* Sort requiring by module names.
PR-URL: https://github.com/nodejs/node/pull/14008
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-tls-server-verify.js')
-rw-r--r-- | test/parallel/test-tls-server-verify.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index 65ddaa5e2d..86a735f64c 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -27,6 +27,11 @@ if (!common.opensslCli) { return; } +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + // This is a rather complex test which sets up various TLS servers with node // and connects to them using the 'openssl s_client' command line utility // with various keys. Depending on the certificate authority and other @@ -35,6 +40,14 @@ if (!common.opensslCli) { // - accepted and "unauthorized", or // - accepted and "authorized". +const assert = require('assert'); +const { spawn } = require('child_process'); +const { SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION } = + require('crypto').constants; +const fs = require('fs'); +const path = require('path'); +const tls = require('tls'); + const testCases = [{ title: 'Do not request certs. Everyone is unauthorized.', requestCert: false, @@ -119,22 +132,9 @@ const testCases = } ]; -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} -const tls = require('tls'); - -const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = - require('crypto').constants.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION; - -const assert = require('assert'); -const fs = require('fs'); -const spawn = require('child_process').spawn; - function filenamePEM(n) { - return require('path').join(common.fixturesDir, 'keys', `${n}.pem`); + return path.join(common.fixturesDir, 'keys', `${n}.pem`); } |