diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index e119ee86172c25..ba3e793e8a5aac 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -105,7 +105,7 @@ testData.forEach((item) => { { input: preprocessed, filename: 'foo', - template: 'doc/template.html', + template: path.resolve(__dirname, '../../doc/template.html'), nodeVersion: process.version, analytics: item.analyticsId, }, diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js index 34681bd235c743..337e8e9b2a5f95 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -94,6 +94,8 @@ child.exec(`${nodejs} --print "os.platform()"`, })); // Module path resolve bug regression test. +const cwd = process.cwd(); +process.chdir(path.resolve(__dirname, '../../')); child.exec(`${nodejs} --eval "require('./test/parallel/test-cli-eval.js')"`, common.mustCall((err, stdout, stderr) => { assert.strictEqual(err.code, 42); @@ -101,6 +103,7 @@ child.exec(`${nodejs} --eval "require('./test/parallel/test-cli-eval.js')"`, stdout, 'Loaded as a module, exiting with status code 42.\n'); assert.strictEqual(stderr, ''); })); +process.chdir(cwd); // Missing argument should not crash. child.exec(`${nodejs} -e`, common.mustCall((err, stdout, stderr) => { diff --git a/test/parallel/test-process-chdir.js b/test/parallel/test-process-chdir.js index f54026467eb6cd..b137be4611c20d 100644 --- a/test/parallel/test-process-chdir.js +++ b/test/parallel/test-process-chdir.js @@ -5,6 +5,7 @@ const assert = require('assert'); const fs = require('fs'); const path = require('path'); +process.chdir('..'); assert.notStrictEqual(process.cwd(), __dirname); process.chdir(__dirname); assert.strictEqual(process.cwd(), __dirname);