From 017909b847851f40613994506785273a951f9235 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 3 Apr 2020 14:05:29 -0400 Subject: [PATCH] test: fix tool path in test-doctool-versions.js Path to the versions tool tested by test-doctool-versions.js would be incorrect if the test temporary directory was redirected (e.g. via NODE_TEST_DIR) outside of `test/`. Signed-off-by: Richard Lau Backport-PR-URL: https://github.com/nodejs/node/pull/32642 PR-URL: https://github.com/nodejs/node/pull/32645 Refs: https://github.com/nodejs/node/pull/32518 Reviewed-By: Colin Ihrig Reviewed-By: Shelley Vohr Reviewed-By: Anna Henningsen --- test/doctool/test-doctool-versions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/doctool/test-doctool-versions.js b/test/doctool/test-doctool-versions.js index a37ead7c0adb5b..5673cc79402df7 100644 --- a/test/doctool/test-doctool-versions.js +++ b/test/doctool/test-doctool-versions.js @@ -9,7 +9,7 @@ const tmpdir = require('../common/tmpdir'); const util = require('util'); const debuglog = util.debuglog('test'); -const versionsTool = path.join('../../tools/doc/versions.js'); +const versionsTool = path.resolve(__dirname, '../../tools/doc/versions.js'); // At the time of writing these are the minimum expected versions. // New versions of Node.js do not have to be explicitly added here. @@ -29,7 +29,7 @@ const expected = [ tmpdir.refresh(); const versionsFile = path.join(tmpdir.path, 'versions.json'); -debuglog(versionsFile); +debuglog(`${process.execPath} ${versionsTool} ${versionsFile}`); const opts = { cwd: tmpdir.path, encoding: 'utf8' }; const cp = spawnSync(process.execPath, [ versionsTool, versionsFile ], opts); debuglog(cp.stderr);