From 7535a94c8a54bb6346c8e60dbae1c32d6f508212 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 17 Jul 2017 15:33:46 -0700 Subject: test: begin normalizing fixtures use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a new `../common/fixtures' module to begin normalizing `test/fixtures` use. Our test code is a bit inconsistent with regards to use of the fixtures directory. Some code uses `path.join()`, some code uses string concats, some other code uses template strings, etc. In mnay cases, significant duplication of code is seen when accessing fixture files, etc. This updates many (but by no means all) of the tests in the test suite to use the new consistent API. There are still many more to update, which would make an excelent Code-n-Learn exercise. PR-URL: https://github.com/nodejs/node/pull/14332 Reviewed-By: Anna Henningsen Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso --- test/parallel/test-cli-eval.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/parallel/test-cli-eval.js') diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js index 7c7ced62fd..0853d7a29b 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -31,6 +31,7 @@ const common = require('../common'); const assert = require('assert'); const child = require('child_process'); const path = require('path'); +const fixtures = require('../common/fixtures'); const nodejs = `"${process.execPath}"`; if (process.argv.length > 2) { @@ -138,7 +139,7 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`, // Regression test for https://github.com/nodejs/node/issues/3574. { - const emptyFile = path.join(common.fixturesDir, 'empty.js'); + const emptyFile = fixtures.path('empty.js'); child.exec(`${nodejs} -e 'require("child_process").fork("${emptyFile}")'`, common.mustCall((err, stdout, stderr) => { -- cgit v1.2.3