Skip to content
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

feat(fs/unstable): add chmod and chmodSync #6343

Merged
merged 8 commits into from
Jan 17, 2025

Conversation

jbronder
Copy link
Contributor

This PR adds the chmod and chmodSync APIs to @std/fs, which are functions intended to mirror Deno.chmod and Deno.chmodSync, respectively.

Towards #6255.

@jbronder jbronder requested a review from kt3k as a code owner January 11, 2025 22:07
@github-actions github-actions bot added the fs label Jan 11, 2025
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 51.72414% with 14 lines in your changes missing coverage. Please review.

Project coverage is 96.37%. Comparing base (b1b557e) to head (f429fff).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
fs/unstable_chmod.ts 51.72% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6343      +/-   ##
==========================================
- Coverage   96.40%   96.37%   -0.04%     
==========================================
  Files         549      550       +1     
  Lines       41851    41880      +29     
  Branches     6348     6351       +3     
==========================================
+ Hits        40348    40362      +14     
- Misses       1463     1478      +15     
  Partials       40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k
Copy link
Member

kt3k commented Jan 14, 2025

We can't use Deno specific features (such as Deno.create, Deno.remove, or Deno.makeTempDir) in testing as these test are also run in Node.js (also we can't use using as it's not supported yet in Node).

One way to work around it is to use node:fs APIs in testing which is supported by both Node and Deno. Another way would be first porting those necessary APIs to std/fs and use them in testing

@jbronder
Copy link
Contributor Author

Ahh, I see. I'll start updating the tests. I appreciate the guidance.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the test. Now this looks perfect!

@kt3k kt3k merged commit 5d41054 into denoland:main Jan 17, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants