From 95741c67b4d9bf5bdf5161d289de5a2093edbb02 Mon Sep 17 00:00:00 2001 From: Adri Van Houdt Date: Mon, 6 Nov 2017 15:03:43 +0000 Subject: [PATCH] test: replace common.fixturesDir with fixtures.readSync() Replace common.fixturesDir with fixtures.readSync() in test-tls-getprotocol. PR-URL: https://github.com/nodejs/node/pull/16802 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott --- test/parallel/test-tls-getprotocol.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js index dd96aa6f7494a6..bf75eb8a398647 100644 --- a/test/parallel/test-tls-getprotocol.js +++ b/test/parallel/test-tls-getprotocol.js @@ -3,9 +3,12 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); +// This test ensures that `getProtocol` returns the right protocol +// from a TLS connection + const assert = require('assert'); const tls = require('tls'); -const fs = require('fs'); +const fixtures = require('../common/fixtures'); const clientConfigs = [ { secureProtocol: 'TLSv1_method', version: 'TLSv1' }, @@ -14,8 +17,8 @@ const clientConfigs = [ ]; const serverConfig = { - key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), - cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) + key: fixtures.readSync('/keys/agent2-key.pem'), + cert: fixtures.readSync('/keys/agent2-cert.pem') }; const server = tls.createServer(serverConfig, common.mustCall(function() {