Skip to content

Commit

Permalink
test: fix tool path in test-doctool-versions.js
Browse files Browse the repository at this point in the history
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 <[email protected]>

Backport-PR-URL: #32642
PR-URL: #32645
Refs: #32518
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
richardlau authored and BethGriggs committed Apr 6, 2020
1 parent a175b8d commit 017909b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/doctool/test-doctool-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down

0 comments on commit 017909b

Please sign in to comment.