Conversation
✅ Sizewatcher found no problematic size increases.
|
Collaborator
mock-fs 5.5.0 throws at require time on Node 26.8+ because nodejs/node#65327 rewrote fs.readFile and the prototype sniffing in mock-fs no longer finds ReadFileContext (tschaub/mock-fs#447, unfixed). The config tests now write .sizewatcher.yml into a fresh tmp directory and chdir into it, matching the pattern already used in cli.test.js. This removes the mock-fs devDependency entirely. Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.
Tests are broken against latest node versions.
Root cause
Node 26.8.0 rewrote fs.readFile (nodejs/node#65327) so it no longer calls the internal open binding from JavaScript. mock-fs 5.5.0 relies on intercepting that call at require time to find the ReadFileContext prototype. It now gets undefined and throws before any test runs. This is tracked upstream as tschaub/mock-fs#447, opened August 27, still open with no fix. I reproduced the failure locally on Node 26.8.2 with the unmodified test.
Fix
Dropped mock-fs entirely rather than pin Node or wait for upstream. The config tests now create a fresh temp directory, write .sizewatcher.yml into it when needed, and chdir into it. This mirrors the pattern already used in cli.test.js, and the tmp package is already a runtime dependency. Working directory is restored after each test.
Changes