From 33f2fff52b7708acee7c430c85f5969f3dcb27ab Mon Sep 17 00:00:00 2001 From: Brian O'Connell Date: Mon, 6 Nov 2017 15:15:14 +0000 Subject: [PATCH] test: refactor tls test to use fixtres.readSync PR-URL: https://github.com/nodejs/node/pull/16816 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil --- test/parallel/test-tls-hello-parser-failure.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index ed4c4f7b991f47..4a7d8999c78d39 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -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);