0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

test: refactor tls test to use fixtres.readSync

PR-URL: https://github.com/nodejs/node/pull/16816
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
Brian O'Connell 2017-11-06 15:15:14 +00:00 committed by Gireesh Punathil
parent 2336df1b50
commit 17d83883e1

View File

@ -22,6 +22,10 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
// This test ensures that the tls parser causes a client error if the client
// sends invalid data.
if (!common.hasCrypto)
common.skip('missing crypto');
@ -30,11 +34,10 @@ const assert = require('assert');
const tls = require('tls');
const net = require('net');
const fs = require('fs');
const options = {
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`),
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`)
key: fixtures.readSync('test_key.pem'),
cert: fixtures.readSync('test_cert.pem')
};
const bonkers = Buffer.alloc(1024 * 1024, 42);