From cf9f1e1fc68eadb419e9b4c0dde58dccfb27458f Mon Sep 17 00:00:00 2001 From: Pooya Paridel Date: Fri, 6 Oct 2017 09:40:18 -0700 Subject: [PATCH 1/2] test: replace common.fixturesDir with usage of common.fixtures module --- test/parallel/test-https-client-reject.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index 82a7851e4e11a6..5cc876c81440e7 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -24,14 +24,16 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); + const assert = require('assert'); const https = require('https'); const fs = require('fs'); const path = require('path'); const options = { - key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), - cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')) + key: fs.readFileSync(fixtures.path('test_key.pem')), + cert: fs.readFileSync(fixtures.path('test_cert.pem')) }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -72,7 +74,7 @@ function rejectUnauthorized() { function authorized() { const options = { port: server.address().port, - ca: [fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))] + ca: [fs.readFileSync(fixtures.path('test_cert.pem'))] }; options.agent = new https.Agent(options); const req = https.request(options, function(res) { From 1d6cde73c03aaccfcdcdfea28353b15d40a2d793 Mon Sep 17 00:00:00 2001 From: Pooya Paridel Date: Fri, 6 Oct 2017 13:15:51 -0700 Subject: [PATCH 2/2] test: replace fs, path and common.fixturesDir with usage of common.fixtures module --- test/parallel/test-https-client-reject.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index 5cc876c81440e7..729256df54ff8c 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -28,12 +28,10 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const https = require('https'); -const fs = require('fs'); -const path = require('path'); const options = { - key: fs.readFileSync(fixtures.path('test_key.pem')), - cert: fs.readFileSync(fixtures.path('test_cert.pem')) + key: fixtures.readSync('test_key.pem'), + cert: fixtures.readSync('test_cert.pem') }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -74,7 +72,7 @@ function rejectUnauthorized() { function authorized() { const options = { port: server.address().port, - ca: [fs.readFileSync(fixtures.path('test_cert.pem'))] + ca: [fixtures.readSync('test_cert.pem')] }; options.agent = new https.Agent(options); const req = https.request(options, function(res) {