From 275e9314b477abc42e2c4701b70a1a79d2bc9c48 Mon Sep 17 00:00:00 2001 From: Alex McKenzie Date: Fri, 6 Oct 2017 11:59:12 -0500 Subject: [PATCH 1/2] test: replaced fixturesDir with fixtures module This was an assigned task at Node.js Interactive North America 2017. This replaced the fixturesDir exported by the common module with the fixturesDir on the common/fixtures module. --- test/parallel/test-http2-respond-file.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-http2-respond-file.js b/test/parallel/test-http2-respond-file.js index 30e0c154504dcf..43d262969dcfae 100644 --- a/test/parallel/test-http2-respond-file.js +++ b/test/parallel/test-http2-respond-file.js @@ -3,6 +3,7 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); const http2 = require('http2'); const assert = require('assert'); const path = require('path'); @@ -14,7 +15,7 @@ const { HTTP2_HEADER_LAST_MODIFIED } = http2.constants; -const fname = path.resolve(common.fixturesDir, 'elipses.txt'); +const fname = path.resolve(fixtures.fixturesDir, 'elipses.txt'); const data = fs.readFileSync(fname); const stat = fs.statSync(fname); From 0798911fab0a359bbedb36a3ce81e1fe818e2500 Mon Sep 17 00:00:00 2001 From: Alex McKenzie Date: Fri, 6 Oct 2017 12:30:30 -0500 Subject: [PATCH 2/2] test: replaced common.fixturesDir with fixtures.path Replaced the path.join using common.fixturesDir with the fixtures.path() function. Removed unnessecary path import. --- test/parallel/test-http2-respond-file.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-http2-respond-file.js b/test/parallel/test-http2-respond-file.js index 43d262969dcfae..c2f513b7cae2b7 100644 --- a/test/parallel/test-http2-respond-file.js +++ b/test/parallel/test-http2-respond-file.js @@ -6,7 +6,6 @@ if (!common.hasCrypto) const fixtures = require('../common/fixtures'); const http2 = require('http2'); const assert = require('assert'); -const path = require('path'); const fs = require('fs'); const { @@ -15,7 +14,7 @@ const { HTTP2_HEADER_LAST_MODIFIED } = http2.constants; -const fname = path.resolve(fixtures.fixturesDir, 'elipses.txt'); +const fname = fixtures.path('elipses.txt'); const data = fs.readFileSync(fname); const stat = fs.statSync(fname);