summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/test_tests.rs12
-rw-r--r--cli/tests/testdata/test/no_prompt_by_default.out7
-rw-r--r--cli/tests/testdata/test/no_prompt_by_default.ts3
-rw-r--r--cli/tests/testdata/test/no_prompt_with_denied_perms.out7
-rw-r--r--cli/tests/testdata/test/no_prompt_with_denied_perms.ts3
5 files changed, 32 insertions, 0 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs
index c80406935..b19cba8f4 100644
--- a/cli/tests/integration/test_tests.rs
+++ b/cli/tests/integration/test_tests.rs
@@ -262,3 +262,15 @@ itest!(steps_invalid_usage {
exit_code: 1,
output: "test/steps/invalid_usage.out",
});
+
+itest!(no_prompt_by_default {
+ args: "test test/no_prompt_by_default.ts",
+ exit_code: 1,
+ output: "test/no_prompt_by_default.out",
+});
+
+itest!(no_prompt_with_denied_perms {
+ args: "test --allow-read test/no_prompt_with_denied_perms.ts",
+ exit_code: 1,
+ output: "test/no_prompt_with_denied_perms.out",
+});
diff --git a/cli/tests/testdata/test/no_prompt_by_default.out b/cli/tests/testdata/test/no_prompt_by_default.out
new file mode 100644
index 000000000..02f1625fa
--- /dev/null
+++ b/cli/tests/testdata/test/no_prompt_by_default.out
@@ -0,0 +1,7 @@
+Check [WILDCARD]/no_prompt_by_default.ts
+running 1 test from [WILDCARD]/no_prompt_by_default.ts
+test no prompt ...
+test result: FAILED. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])
+
+error: Uncaught (in promise) PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag
+[WILDCARD]
diff --git a/cli/tests/testdata/test/no_prompt_by_default.ts b/cli/tests/testdata/test/no_prompt_by_default.ts
new file mode 100644
index 000000000..816454a2e
--- /dev/null
+++ b/cli/tests/testdata/test/no_prompt_by_default.ts
@@ -0,0 +1,3 @@
+Deno.test("no prompt", () => {
+ Deno.readTextFile("./some_file.txt");
+});
diff --git a/cli/tests/testdata/test/no_prompt_with_denied_perms.out b/cli/tests/testdata/test/no_prompt_with_denied_perms.out
new file mode 100644
index 000000000..07a7eb6a2
--- /dev/null
+++ b/cli/tests/testdata/test/no_prompt_with_denied_perms.out
@@ -0,0 +1,7 @@
+Check [WILDCARD]/no_prompt_with_denied_perms.ts
+running 1 test from [WILDCARD]/no_prompt_with_denied_perms.ts
+test no prompt ...
+test result: FAILED. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])
+
+error: Uncaught (in promise) PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag
+[WILDCARD]
diff --git a/cli/tests/testdata/test/no_prompt_with_denied_perms.ts b/cli/tests/testdata/test/no_prompt_with_denied_perms.ts
new file mode 100644
index 000000000..ee3736cff
--- /dev/null
+++ b/cli/tests/testdata/test/no_prompt_with_denied_perms.ts
@@ -0,0 +1,3 @@
+Deno.test("no prompt", { permissions: { read: false } }, () => {
+ Deno.readTextFile("./some_file.txt");
+});