Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/parallel/test-tls-net-connect-prefer-path.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');

// This tests that both tls and net will ignore host and port if path is
// provided.
Expand Down Expand Up @@ -28,8 +29,8 @@ function mkServer(lib, tcp, cb) {
const args = [handler];
if (lib === tls) {
args.unshift({
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`),
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`)
cert: fs.readFileSync(fixtures.path('test_cert.pem')),
key: fs.readFileSync(fixtures.path('test_key.pem'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixtures module has a helper that make this even simpler! Check out fixtures.readSync().

That should let you do key: fixtures.readSync('test_key.pem') instead.

});
}
const server = lib.createServer(...args);
Expand Down