From 06cf9f22aa9c80f1211f1c1b5fa74b302c43d30c Mon Sep 17 00:00:00 2001 From: Lam Chan Date: Fri, 6 Oct 2017 10:04:46 -0700 Subject: [PATCH 1/4] test: replaced fs.readSync with fixtures.readSync NINA 2017 Code and Learn session for first time contributors. This touched test/parallel/test-https-socket-options.js to replace common.fixturesDir --- test/parallel/test-https-socket-options.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index 2a6fc8f84f78af..ec4e95295a38c9 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -21,6 +21,7 @@ 'use strict'; const common = require('../common'); +const fixtures = require('../common/fixtures'); if (!common.hasCrypto) common.skip('missing crypto'); @@ -30,8 +31,8 @@ const fs = require('fs'); const http = require('http'); const options = { - key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), - cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) + key: fixtures.readSync(`/keys/agent1-key.pem`), + cert: fixtures.readSync(`/keys/agent1-cert.pem`) }; const body = 'hello world\n'; From 949ae1b4ad17b69833acfa52da5f797d7022a64e Mon Sep 17 00:00:00 2001 From: Lam Chan Date: Fri, 6 Oct 2017 10:24:51 -0700 Subject: [PATCH 2/4] test: optimizing the use of the fixtures library changing calls from fixtures.readSync to fixtures.readKey where applicable. --- test/parallel/test-https-socket-options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index ec4e95295a38c9..8d851695fe1aba 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -31,8 +31,8 @@ const fs = require('fs'); const http = require('http'); const options = { - key: fixtures.readSync(`/keys/agent1-key.pem`), - cert: fixtures.readSync(`/keys/agent1-cert.pem`) + key: fixtures.readKey('agent1-key.pem'), + cert: fixtures.readKey('git stagent1-cert.pem') }; const body = 'hello world\n'; From 1b5a46086224da99090995d357ab2ace0c45530a Mon Sep 17 00:00:00 2001 From: Lam Chan Date: Fri, 6 Oct 2017 10:27:37 -0700 Subject: [PATCH 3/4] test: fixed typo fixed typo with pem key` --- test/parallel/test-https-socket-options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index 8d851695fe1aba..b591d5caff582b 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -32,7 +32,7 @@ const http = require('http'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('git stagent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem') }; const body = 'hello world\n'; From 1bfc2e9d7ebf0767937d195990dc5c1160cd0633 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 15 Oct 2017 15:11:46 -0700 Subject: [PATCH 4/4] [Squash] Fix nits --- test/parallel/test-https-socket-options.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index b591d5caff582b..2ba1b883684205 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -21,13 +21,12 @@ 'use strict'; const common = require('../common'); -const fixtures = require('../common/fixtures'); if (!common.hasCrypto) common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); const https = require('https'); -const fs = require('fs'); const http = require('http'); const options = {