diff options
author | ashleyraymaceli <ashley.maceli@gmail.com> | 2017-10-06 10:33:46 -0700 |
---|---|---|
committer | Gibson Fahnestock <gibfahn@gmail.com> | 2017-10-08 09:46:06 -0700 |
commit | 86d803b3855ef8cf3b14510f484fdbdb17872533 (patch) | |
tree | 5413bf82dfe36ed6a0cf8879a19f7a54bb836b7c /test/parallel/test-http2-https-fallback.js | |
parent | 2b5b423dffec7e2250e6153c6d6c3a21d7086664 (diff) | |
download | node-new-86d803b3855ef8cf3b14510f484fdbdb17872533.tar.gz |
test: replace common.fixturesDir with readKey
PR-URL: https://github.com/nodejs/node/pull/15946
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-https-fallback.js')
-rw-r--r-- | test/parallel/test-http2-https-fallback.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/test/parallel/test-http2-https-fallback.js b/test/parallel/test-http2-https-fallback.js index 266c6f89f3..4dabe4e69d 100644 --- a/test/parallel/test-http2-https-fallback.js +++ b/test/parallel/test-http2-https-fallback.js @@ -1,13 +1,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'); @@ -16,13 +15,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 }) }; |