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.
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
kraenhansen
left a comment
There was a problem hiding this comment.
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.