From a0bc9b217f746749b7457c9b89910d9edccdeb64 Mon Sep 17 00:00:00 2001 From: Bob Clewell Date: Fri, 6 Oct 2017 09:42:42 -0700 Subject: [PATCH 1/2] test: change to common fixtures module in test file Task to replace the common.fixturesDir with the usage of the common.fixtures module. At Node.js Interactive. First PR to Node.js. Yay! --- test/parallel/test-https-set-timeout-server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-https-set-timeout-server.js b/test/parallel/test-https-set-timeout-server.js index b5cc8a6f5a2664..c841970785df81 100644 --- a/test/parallel/test-https-set-timeout-server.js +++ b/test/parallel/test-https-set-timeout-server.js @@ -21,6 +21,7 @@ 'use strict'; const common = require('../common'); +const fixtures = require('../common/fixtures'); if (!common.hasCrypto) common.skip('missing crypto'); @@ -34,8 +35,8 @@ const tls = require('tls'); const tests = []; const serverOptions = { - key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), - cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) + key: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-key.pem`), + cert: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-cert.pem`) }; function test(fn) { From e1089e2def85653f5ee865494db7a2af6d086e55 Mon Sep 17 00:00:00 2001 From: Bob Clewell Date: Mon, 9 Oct 2017 14:18:51 -0400 Subject: [PATCH 2/2] test: Updated test to use readKey rather than fixturesDir --- test/parallel/test-https-set-timeout-server.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-https-set-timeout-server.js b/test/parallel/test-https-set-timeout-server.js index c841970785df81..e353f0afde5a92 100644 --- a/test/parallel/test-https-set-timeout-server.js +++ b/test/parallel/test-https-set-timeout-server.js @@ -21,13 +21,12 @@ 'use strict'; const common = require('../common'); -const fixtures = require('../common/fixtures'); if (!common.hasCrypto) common.skip('missing crypto'); const assert = require('assert'); -const fs = require('fs'); +const fixtures = require('../common/fixtures'); const https = require('https'); const http = require('http'); const tls = require('tls'); @@ -35,8 +34,8 @@ const tls = require('tls'); const tests = []; const serverOptions = { - key: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-key.pem`), - cert: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-cert.pem`) + key: fixtures.readKey('agent1-key.pem'), + cert: fixtures.readKey('agent1-cert.pem') }; function test(fn) {