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

Build: fix test failure on Node 11 #11100

Merged
merged 1 commit into from Nov 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/lib/util/npm-utils.js
Expand Up @@ -162,8 +162,7 @@ describe("npmUtils", () => {
});

it("should return false if package.json does not exist", () => {
mockFs({});
assert.strictEqual(npmUtils.checkPackageJson(), false);
assert.strictEqual(npmUtils.checkPackageJson("/"), false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this also work on windows where / is not the root directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should work since the Node fs APIs normalize paths automatically (and the Windows build for this change appears to have passed). Is the test failing for you on Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use Windows, so it's not failing for me.
I was just curious whether this is working as intended. Looks like it does, thanks.

});
});

Expand Down