diff --git a/test/parallel/test-http2-https-fallback.js b/test/parallel/test-http2-https-fallback.js index d49c7987143d33..df4378e9e65c2e 100644 --- a/test/parallel/test-http2-https-fallback.js +++ b/test/parallel/test-http2-https-fallback.js @@ -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'); @@ -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 }) };