Skip to content

Commit 86d803b

Browse files
AshleyRayMaceligibfahn
authored andcommitted
test: replace common.fixturesDir with readKey
PR-URL: #15946 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 2b5b423 commit 86d803b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/parallel/test-http2-https-fallback.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
'use strict';
22

33
const common = require('../common');
4+
const fixtures = require('../common/fixtures');
45

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

89
const { strictEqual } = require('assert');
9-
const { join } = require('path');
10-
const { readFileSync } = require('fs');
1110
const { createSecureContext } = require('tls');
1211
const { createSecureServer, connect } = require('http2');
1312
const { get } = require('https');
@@ -16,13 +15,9 @@ const { connect: tls } = require('tls');
1615

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

19-
function loadKey(keyname) {
20-
return readFileSync(join(common.fixturesDir, 'keys', keyname));
21-
}
22-
23-
const key = loadKey('agent8-key.pem');
24-
const cert = loadKey('agent8-cert.pem');
25-
const ca = loadKey('fake-startcom-root-cert.pem');
18+
const key = fixtures.readKey('agent8-key.pem');
19+
const cert = fixtures.readKey('agent8-cert.pem');
20+
const ca = fixtures.readKey('fake-startcom-root-cert.pem');
2621

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

0 commit comments

Comments
 (0)