Skip to content

Commit

Permalink
test: replace common.fixturesDir with readKey
Browse files Browse the repository at this point in the history
PR-URL: #15946
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
AshleyRayMaceli authored and MylesBorins committed Oct 11, 2017
1 parent 67cef9b commit 73231d9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/parallel/test-http2-https-fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
'use strict';

const common = require('../common');
const fixtures = require('../common/fixtures');

if (!common.hasCrypto)
common.skip('missing crypto');

const { strictEqual } = require('assert');
const { join } = require('path');
const { readFileSync } = require('fs');
const { createSecureContext } = require('tls');
const { createSecureServer, connect } = require('http2');
const { get } = require('https');
Expand All @@ -17,13 +16,9 @@ const { connect: tls } = require('tls');

const countdown = (count, done) => () => --count === 0 && done();

function loadKey(keyname) {
return readFileSync(join(common.fixturesDir, 'keys', keyname));
}

const key = loadKey('agent8-key.pem');
const cert = loadKey('agent8-cert.pem');
const ca = loadKey('fake-startcom-root-cert.pem');
const key = fixtures.readKey('agent8-key.pem');
const cert = fixtures.readKey('agent8-cert.pem');
const ca = fixtures.readKey('fake-startcom-root-cert.pem');

const clientOptions = { secureContext: createSecureContext({ ca }) };

Expand Down

0 comments on commit 73231d9

Please sign in to comment.