Skip to content

Commit e4dae78

Browse files
committed
test: tighten permissions
1 parent 2550ebd commit e4dae78

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
nix_version: 2.31.2
5353
- uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1
5454
- run: deno task build
55-
- run: deno test --allow-read
55+
- run: deno test -P
5656
typecheck:
5757
name: Check TypeScript
5858
runs-on: ubuntu-24.04

deno.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
"exclude": ["!src/main.wasm", "!src/wasm_exec.js"]
1515
},
1616
"tasks": {
17-
"build": "deno run --allow-env --allow-read --allow-run --allow-write build.ts",
18-
"test": "deno test --allow-read"
17+
"build": "deno run --allow-env --allow-read --allow-run --allow-write build.ts"
18+
},
19+
"test": {
20+
"permissions": {
21+
"read": ["src/main.wasm", "tests/publiccode.yml"]
22+
}
1923
}
2024
}

tests/mod_test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { initializeWasm, validator } from "../src/validator.ts";
55
await initializeWasm();
66

77
Deno.test("Simple test", async () => {
8-
const path = new URL("./publiccode.yml", import.meta.url);
9-
const publicCodeYaml = await Deno.readTextFile(path);
8+
const publicCodeYaml = await Deno.readTextFile("tests/publiccode.yml");
109

1110
const res = await validator({ publiccode: publicCodeYaml });
1211

0 commit comments

Comments
 (0)