Skip to content

update permissions samples on testing.md #1664

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kuboon
Copy link

@kuboon kuboon commented Apr 25, 2025

I was confused by the permissions option in Deno.test, so I’d like to suggest a correction.

In the early example, permissions: { read: true }, is included, but the test actually passes even without it. I found this point unclear, so I think it should be removed.

A more detailed explanation is provided in the ## Tests and Permissions section, but including the unnecessary permissions: { read: true }, there as well makes the line "allows you to specifically deny permissions, but does not grant them." harder to understand.

What do you think?

@@ -97,7 +96,7 @@ deno test my_test.ts -- -e --foo --bar

# Provide permission for deno to read from the filesystem, which is necessary
# for the final test above to pass
deno test --allow-read my_test.ts
deno test --allow-read=. my_test.ts
Copy link
Author

Choose a reason for hiding this comment

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

This is a bit of a personal preference, but I have a strong desire to promote the practice of not granting broad permissions too easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant