Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: don't use cwd for relative path #4477

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions test/parallel/test-fs-realpath.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,10 @@ function test_relative_input_cwd(callback) {
return runNextTest();
}

// we need to get the relative path to the tmp dir from cwd.
// When the test runner is running it, that will be .../node/test
// but it's more common to run `./node test/.../`, so detect it here.
// we need to calculate the relative path to the tmp dir from cwd
var entrydir = process.cwd();
var entry = common.tmpDir.substr(entrydir.length + 1) + '/cycles/realpath-3a';
var entry = path.relative(entrydir,
path.join(common.tmpDir + '/cycles/realpath-3a'));
var expected = common.tmpDir + '/cycles/root.js';
[
[entry, '../cycles/realpath-3b'],
Expand Down