-
Notifications
You must be signed in to change notification settings - Fork 4
Run unit tests under Windows #106
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
Conversation
|
…he nodejs ecosystem. I'm trying to set the file/dir as offline to simulate it being otherwise inaccessible.
…rshell in some brittle way, and it just doesn't appear feasible for the unreadable directory case. The other unreadable file case is covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aims to improve file permission handling and path normalization in the node API modules to ensure unit tests run properly on Windows. Key changes include:
- Refactoring the file readability check in isNodeApiModule with a new helper function (isReadableSync) and improved error messaging.
- Adjustments to normalize module paths for cross-platform compatibility.
- Updates to unit tests to simulate changes in file permission behavior on Windows using fswin, plus the addition of a dedicated Windows test workflow.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react-native-node-api-modules/src/node/path-utils.ts | Enhanced file readability checking and path normalization for cross-platform support. |
packages/react-native-node-api-modules/src/node/path-utils.test.ts | Added helper functions to simulate removal and restoration of read permissions on Windows. |
packages/react-native-node-api-modules/package.json | Added fswin dependency for Windows file attribute management. |
.github/workflows/check.yml | Introduced a Windows test job to run the adjusted test suite. |
packages/react-native-node-api-modules/src/node/path-utils.test.ts
Outdated
Show resolved
Hide resolved
packages/react-native-node-api-modules/src/node/path-utils.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few minor suggestions - pick what you feel like and merge at will 🙂
…t.ts Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Kræn Hansen <[email protected]>
attempt to get some early visibility into pathing or other issues. should "just work" with this subset of tests.