Repository navigation
fix(tools): update failing tests on main - #51980
Merged
Merged
Conversation
|
👀 Review this PR in a CodeSee Review Map |
raisedadead
approved these changes
Oct 15, 2023
Member
|
These work on node |
huyenltnguyen
approved these changes
Oct 15, 2023
huyenltnguyen
left a comment
Member
There was a problem hiding this comment.
LGTM 👍
I think we should create an issue to track the removal of the workaround though.
4 tasks done
Member
|
I think we will need to pin Node on 20.7.0 as well. I tested the PR locally and confirmed that the tests pass on v20.7 but some fail on v20.8, as @gikf pointed out. |
Member
Author
huyenltnguyen
left a comment
Member
There was a problem hiding this comment.
Could we revert the .toString('utf-8') workaround then, or do we still need it?
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Checklist:
mainbranch of freeCodeCamp.Tracing this issue back, discovered that some optimisation changes to the fs.readFileSync broke the ability for
mock-fsto mock the file system correctly.The workaround for this, until the upstream issue is fixed, is to not pass the
utf-8argument, but to instead calltoString('utf-8')on the returned Buffer.This also meant that
matter.read()was unusable, as it appears to default to passing the parameter. Instead, we have to read the file separately, and pass the contents tomatter()directly.Tools tests are now all passing locally for me on my node 20 instance.