From cc1a47dc6b94b2feb4de9e46be9333d81d537783 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 30 Jun 2017 20:52:53 +0300 Subject: 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 Reviewed-By: Colin Ihrig --- test/parallel/test-tls-server-verify.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'test/parallel/test-tls-server-verify.js') 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`); } -- cgit v1.2.3