Skip to content

Commit

Permalink
test: replace common.fixturesDir with fixtures.readSync()
Browse files Browse the repository at this point in the history
Replace common.fixturesDir with fixtures.readSync() in
test-tls-getprotocol.

PR-URL: #16802
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
AdriVanHoudt authored and MylesBorins committed Nov 16, 2017
1 parent 40fa970 commit 1e6845d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/parallel/test-tls-getprotocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand All @@ -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() {
Expand Down

0 comments on commit 1e6845d

Please sign in to comment.