summaryrefslogtreecommitdiff
path: root/cli/tests/integration/run_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r--cli/tests/integration/run_tests.rs56
1 files changed, 56 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index d42136f84..10ff6d2e0 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -591,6 +591,62 @@ fn _090_run_permissions_request_sync() {
]);
}
+#[test]
+fn permissions_prompt_allow_all() {
+ let args = "run --quiet run/permissions_prompt_allow_all.ts";
+ use util::PtyData::*;
+ util::test_pty2(args, vec![
+ // "run" permissions
+ Output("┌ ⚠️ Deno requests run access to \"FOO\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-run to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all run access.\r\n"),
+ // "read" permissions
+ Output("┌ ⚠️ Deno requests read access to \"FOO\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-read to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all read access.\r\n"),
+ // "write" permissions
+ Output("┌ ⚠️ Deno requests write access to \"FOO\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-write to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all write permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all write access.\r\n"),
+ // "net" permissions
+ Output("┌ ⚠️ Deno requests net access to \"FOO\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-net to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all net permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all net access.\r\n"),
+ // "env" permissions
+ Output("┌ ⚠️ Deno requests env access to \"FOO\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-env to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all env access.\r\n"),
+ // "sys" permissions
+ Output("┌ ⚠️ Deno requests sys access to \"loadavg\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-sys to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all sys access.\r\n"),
+ // "ffi" permissions
+ Output("┌ ⚠️ Deno requests ffi access to \"FOO\".\r\n├ Requested by `Deno.permissions.query()` API\r\n ├ Run again with --allow-ffi to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all ffi permissions) >"),
+ Input("a\n"),
+ Output("✅ Granted all ffi access.\r\n")
+ ]);
+}
+
+#[test]
+fn permissions_prompt_allow_all_2() {
+ let args = "run --quiet run/permissions_prompt_allow_all_2.ts";
+ use util::PtyData::*;
+ util::test_pty2(args, vec![
+ // "env" permissions
+ Output("┌ ⚠️ Deno requests env access to \"FOO\".\r\n├ Run again with --allow-env to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) >"),
+ Input("d\n"),
+ Output("✅ Granted all env access.\r\n"),
+ // "sys" permissions
+ Output("┌ ⚠️ Deno requests sys access to \"FOO\".\r\n├ Run again with --allow-sys to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions) >"),
+ Input("d\n"),
+ Output("✅ Granted all sys access.\r\n"),
+ // "read" permissions
+ Output("┌ ⚠️ Deno requests read access to \"FOO\".\r\n├ Run again with --allow-read to bypass this prompt.\r\n└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions) >"),
+ Input("d\n"),
+ Output("✅ Granted all read access.\r\n"),
+ ]);
+}
+
itest!(_091_use_define_for_class_fields {
args: "run --check run/091_use_define_for_class_fields.ts",
output: "run/091_use_define_for_class_fields.ts.out",