From 3d8b3f7b4aeacfd49ded5aed3f674e439c174426 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 a6659d4578bc9b..9d9f8c77716b64 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -1,6 +1,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'); @@ -9,11 +13,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);