diff options
author | Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps> | 2024-08-20 04:20:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 01:20:06 +0000 |
commit | 4f49f703c10afcde7155baac2b494fa6670c0115 (patch) | |
tree | ad9231735e1fc57a71e77de97dc0ac20ea9705a6 /tests | |
parent | 0eba180fdbfdc19e15c743f00382d3fc79f65a10 (diff) |
fix(cli): update permission prompt message for compiled binaries (#24081)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'tests')
4 files changed, 28 insertions, 1 deletions
diff --git a/tests/specs/compile/permissions_denied/__test__.jsonc b/tests/specs/compile/permissions_denied/__test__.jsonc new file mode 100644 index 000000000..8f8590162 --- /dev/null +++ b/tests/specs/compile/permissions_denied/__test__.jsonc @@ -0,0 +1,24 @@ +{ + "tempDir": true, + "steps": [{ + "if": "unix", + "args": "compile --output main main.ts", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "exitCode": 1, + "output": "main.out" + }, { + "if": "windows", + "args": "compile --output main.exe main.ts", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "exitCode": 1, + "output": "main.out" + }] +} diff --git a/tests/specs/compile/permissions_denied/main.out b/tests/specs/compile/permissions_denied/main.out new file mode 100644 index 000000000..e9ea45c81 --- /dev/null +++ b/tests/specs/compile/permissions_denied/main.out @@ -0,0 +1,2 @@ +error: Uncaught (in promise) PermissionDenied: Requires run access to "deno", specify the required permissions during compilation using `deno compile --allow-run` +[WILDCARD]
\ No newline at end of file diff --git a/tests/specs/compile/permissions_denied/main.ts b/tests/specs/compile/permissions_denied/main.ts new file mode 100644 index 000000000..eeac858ff --- /dev/null +++ b/tests/specs/compile/permissions_denied/main.ts @@ -0,0 +1 @@ +new Deno.Command("deno").outputSync(); diff --git a/tests/testdata/npm/deno_run_cowsay_no_permissions.out b/tests/testdata/npm/deno_run_cowsay_no_permissions.out index 206ef1484..837394d49 100644 --- a/tests/testdata/npm/deno_run_cowsay_no_permissions.out +++ b/tests/testdata/npm/deno_run_cowsay_no_permissions.out @@ -1,2 +1,2 @@ -error: Uncaught PermissionDenied: Requires read access to <CWD>, run again with the --allow-read flag +error: Uncaught PermissionDenied: Requires read access to <CWD>, specify the required permissions during compilation using `deno compile --allow-read` [WILDCARD] |