@@ -48,7 +48,6 @@ Deno.test("async test", async () => {
48
48
49
49
Deno .test ({
50
50
name: " read file test" ,
51
- permissions: { read: true },
52
51
fn : () => {
53
52
const data = Deno .readTextFileSync (" ./somefile.txt" );
54
53
assertEquals (data , " expected content" );
@@ -97,7 +96,7 @@ deno test my_test.ts -- -e --foo --bar
97
96
98
97
# Provide permission for deno to read from the filesystem, which is necessary
99
98
# for the final test above to pass
100
- deno test --allow-read my_test.ts
99
+ deno test --allow-read=. my_test.ts
101
100
```
102
101
103
102
## Test Steps
@@ -611,7 +610,7 @@ import getFileText from "./main.ts";
611
610
612
611
Deno .test ({
613
612
name: " File reader gets text with permission" ,
614
- permissions: { read: true },
613
+ // no `permissions` means "inherit"
615
614
fn : async () => {
616
615
const result = await getFileText ();
617
616
console .log (result );
@@ -640,11 +639,10 @@ The permissions object supports detailed configuration:
640
639
``` ts
641
640
Deno .test ({
642
641
name: " permission configuration example" ,
642
+ // permissions: { read: true } // Grant all read permissions and deny all others
643
+ // OR
643
644
permissions: {
644
- read: true , // Grant all read permissions
645
- // OR
646
645
read: [" ./data" , " ./config" ], // Grant read to specific paths only
647
-
648
646
write: false , // Explicitly deny write permissions
649
647
net: [" example.com:443" ], // Allow specific host:port combinations
650
648
env: [" API_KEY" ], // Allow access to specific env variables
0 commit comments