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

Fix tests on Node 20.8.0+ #603

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Fix tests on Node 20.8.0+ #603

merged 4 commits into from
Jan 16, 2024

Conversation

chadlwilson
Copy link
Contributor

@chadlwilson chadlwilson commented Oct 3, 2023

mock-fs performs deep mocking on node/fs internals which seems to be rather brittle. And it's broken on Node 20.8.0+ right now.

Based on the changelog at https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#2023-09-28-version-2080-current-ruyadorno , I am guessing it's some of the changes such as nodejs/node#49593 or nodejs/node#49691

Replaced here with mock-tmp, a simple library that keeps roughly the same API as mock-fs for ease of migration, but uses real files on the filesystem.

Signed-off-by: Chad Wilson <chadw@thoughtworks.com>
@chadlwilson chadlwilson added ReleaseCandidate If a PR is tagged with this label, after merging it will be released and removed help wanted labels Jan 16, 2024
@gaugebot
Copy link

gaugebot bot commented Jan 16, 2024

@chadlwilson Thank you for contributing to gauge-js. Your pull request has been labeled as a release candidate 🎉🎉.

Merging this PR will trigger a release.

Please bump up the version as part of this PR.

Instructions to bump the version can found at CONTRIBUTING.md

If the CONTRIBUTING.md file does not exist or does not include instructions about bumping up the version, please looks previous commits in git history to see what changes need to be done.

@chadlwilson chadlwilson changed the title Fix build on Node 20.8.0+ Fix tests on Node 20.8.0+ Jan 16, 2024
Switch to mock-tmp which avoids attempting to mock the node `fs` package, which is increasingly difficult, and instead just creates
a dummy file structure in temp directories.

Signed-off-by: Chad Wilson <chadw@thoughtworks.com>
Signed-off-by: Chad Wilson <chadw@thoughtworks.com>
Signed-off-by: Chad Wilson <chadw@thoughtworks.com>
@chadlwilson chadlwilson marked this pull request as ready for review January 16, 2024 14:08
@chadlwilson chadlwilson merged commit 6de0a63 into master Jan 16, 2024
8 checks passed
@chadlwilson chadlwilson deleted the node-2080 branch January 16, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ReleaseCandidate If a PR is tagged with this label, after merging it will be released
Development

Successfully merging this pull request may close these issues.

1 participant