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.js 20 #169

Open
XhmikosR opened this issue Nov 22, 2023 · 5 comments
Open

Fix tests on Node.js 20 #169

XhmikosR opened this issue Nov 22, 2023 · 5 comments

Comments

@XhmikosR
Copy link
Member

Something changed in Node.js 20 and tests fail on main since a few months now.

If someone figures out why, please make a PR and CC me.

@GiladShoham
Copy link

GiladShoham commented Nov 29, 2023

I have the same problem.
@XhmikosR which version of node it started?

Seems like it works with 20.4.0 but fail on 20.5.0

@GiladShoham
Copy link

Maybe it's related to this change in 20.5.0
[986b46a567] - fs: add a fast-path for readFileSync utf-8 (Yagiz Nizipli) nodejs/node#48658

@GiladShoham
Copy link

GiladShoham commented Nov 29, 2023

another relevant reference is here - kubernetes-client/javascript#1202
and also this one - tschaub/mock-fs#377

@XhmikosR
Copy link
Member Author

XhmikosR commented Apr 4, 2024

@GiladShoham yeah you are probably right. Unsure how to make tests pass again on Node.js 20. If you have any suggestions feel free to make a PR and CC me.

EDIT: I just looked at your linked PRs. It seems it's just a matter of calling toString('utf-8'). Anyway, feel free to make a PR.

@XhmikosR
Copy link
Member Author

XhmikosR commented Apr 5, 2024

I pushed a branch with debug enabled on CI and the issue seems to be with fs.existsSync:

Unsure how to proceed...

We are also hitting this in other repos like node-stylus-lookup:

EDIT: looks like it's a mock-fs issue? tschaub/mock-fs#377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants