test: chdir before running test-cli-node-options

When test-cli-node-options is run it uses the --trace-events-enabled
option which generates a file named node_trace.1.log. This commit
changes the working directory to the test tmp directory to avoid this
file being created in the project root.

Backport-PR-URL: https://github.com/nodejs/node/pull/12677
PR-URL: https://github.com/nodejs/node/pull/12660
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Daniel Bevenius authored and Myles Borins committed 2017-10-25 04:09:42 -04:00
1 parent 16f8f9b03f
commit ba830f0352
1 file changed
+3
+3
View File
@@ -8,6 +8,9 @@ if (process.config.variables.node_without_node_options)
const assert = require('assert');
const exec = require('child_process').execFile;
common.refreshTmpDir();
process.chdir(common.tmpDir);
disallow('--version');
disallow('-v');
disallow('--help');