summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-session-cache.js
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-15 03:30:28 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-21 20:40:52 +0300
commit4f875222445b07016a8294fa5a5bf7418c735489 (patch)
treefcb4996be68507c06dec905eacff6300d74319e7 /test/parallel/test-tls-session-cache.js
parent43bd47c352a368db6051b1017225abace015d3c9 (diff)
downloadandroid-node-v8-4f875222445b07016a8294fa5a5bf7418c735489.tar.gz
android-node-v8-4f875222445b07016a8294fa5a5bf7418c735489.tar.bz2
android-node-v8-4f875222445b07016a8294fa5a5bf7418c735489.zip
doc, lib, test: do not re-require needlessly
PR-URL: https://github.com/nodejs/node/pull/14244 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Diffstat (limited to 'test/parallel/test-tls-session-cache.js')
-rw-r--r--test/parallel/test-tls-session-cache.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js
index 805c21b3ad..a6d00d2c07 100644
--- a/test/parallel/test-tls-session-cache.js
+++ b/test/parallel/test-tls-session-cache.js
@@ -28,6 +28,15 @@ if (!common.opensslCli)
if (!common.hasCrypto)
common.skip('missing crypto');
+const assert = require('assert');
+const tls = require('tls');
+const fs = require('fs');
+const { join } = require('path');
+const { spawn } = require('child_process');
+
+const keyFile = join(common.fixturesDir, 'agent.key');
+const certFile = join(common.fixturesDir, 'agent.crt');
+
doTest({ tickets: false }, function() {
doTest({ tickets: true }, function() {
doTest({ tickets: false, invalidSession: true }, function() {
@@ -37,14 +46,6 @@ doTest({ tickets: false }, function() {
});
function doTest(testOptions, callback) {
- const assert = require('assert');
- const tls = require('tls');
- const fs = require('fs');
- const join = require('path').join;
- const spawn = require('child_process').spawn;
-
- const keyFile = join(common.fixturesDir, 'agent.key');
- const certFile = join(common.fixturesDir, 'agent.crt');
const key = fs.readFileSync(keyFile);
const cert = fs.readFileSync(certFile);
const options = {