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]>

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 targos committed Apr 11, 2020
1 parent ba0ea79 commit ed89863
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 ed89863

Please sign in to comment.