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 <riclau@uk.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/32645
Refs: https://github.com/nodejs/node/pull/32518
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
pull/32673/head
Richard Lau 2020-04-03 14:05:29 -04:00 committed by Anna Henningsen
parent 8c0a17ae28
commit 0ddfd0fc12
No known key found for this signature in database
GPG Key ID: A94130F0BFC8EBE9
1 changed files with 2 additions and 2 deletions

View File

@ -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);