Skip to content

Commit 73231d9

Browse files
AshleyRayMaceliMylesBorins
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 67cef9b commit 73231d9

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
@@ -2,13 +2,12 @@
22
'use strict';
33

44
const common = require('../common');
5+
const fixtures = require('../common/fixtures');
56

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

910
const { strictEqual } = require('assert');
10-
const { join } = require('path');
11-
const { readFileSync } = require('fs');
1211
const { createSecureContext } = require('tls');
1312
const { createSecureServer, connect } = require('http2');
1413
const { get } = require('https');
@@ -17,13 +16,9 @@ const { connect: tls } = require('tls');
1716

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

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

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

0 commit comments

Comments
 (0)