Repository navigation
test(jest): use a folder below a file for the unwritable diagnostics case - #302
Open
TheSeydiCharyyev wants to merge 1 commit into
Open
TheSeydiCharyyev wants to merge 1 commit into
TheSeydiCharyyev wants to merge 1 commit into
Conversation
|
@TheSeydiCharyyev is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
TheSeydiCharyyev
marked this pull request as ready for review
October 29, 2026 11:39
This branch has not been deployed
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.
What is this?
On Windows, the diagnostics test "never throws when the directory cannot be written" does not meet an unwritable folder. It uses
projectRoot: '/dev/null/nope'. On Linux and macOS/dev/nullis a device, so no folder can be created below it. On Windows, Node resolves the path against the root of the current drive, and the appender creates\dev\null\nope\.harness\diagnostics\unwritable.jsonlthere. The case passes, and the folder stays on the drive after the run (#301).How does it work?
The case now writes an empty file in its temp folder and uses a path below that file as
projectRoot. A folder below a regular file can't be created on any platform (ENOTDIR), so the appender meets the error the case is about. The temp folder is removed after each case, as before. The case also checks that the.jsonlfile does not exist afterdispose(). With/dev/null/nopethis check fails on Windows 11 (expected true to be false). With the new path, all 27 cases in the file pass and nothing is written under\dev\null. Production code is unchanged. I ran the tests on Windows 11 only; Linux and macOS run them in CI.Why is this useful?
The case tests what its name says on every platform, and a test run on Windows no longer leaves
\dev\nullon the drive. While that folder exists, Git for Windows fails on commands that open/dev/nullas a path, for examplegit diff --no-index /dev/null <file>.Fixes #301