Skip to content

Commit 3d8b3f7

Browse files
brianoconnellMylesBorins
authored andcommitted
test: refactor tls test to use fixtres.readSync
PR-URL: #16816 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 54d4557 commit 3d8b3f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/parallel/test-tls-hello-parser-failure.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

33
const common = require('../common');
4+
const fixtures = require('../common/fixtures');
5+
6+
// This test ensures that the tls parser causes a client error if the client
7+
// sends invalid data.
48

59
if (!common.hasCrypto)
610
common.skip('missing crypto');
@@ -9,11 +13,10 @@ const assert = require('assert');
913
const tls = require('tls');
1014

1115
const net = require('net');
12-
const fs = require('fs');
1316

1417
const options = {
15-
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`),
16-
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`)
18+
key: fixtures.readSync('test_key.pem'),
19+
cert: fixtures.readSync('test_cert.pem')
1720
};
1821

1922
const bonkers = Buffer.alloc(1024 * 1024, 42);

0 commit comments

Comments
 (0)