diff options
| author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2022-04-18 20:08:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-18 21:08:30 +0200 |
| commit | 66fbdd2ed4b5ecab8a51278cd76bce7adedb4fc2 (patch) | |
| tree | 55e38ace63362cb49ac8cf9a5f66594a04770335 /cli/tests/integration | |
| parent | bf804d3ffff39dab3c7fc8a1a91538ec51276223 (diff) | |
feat: Add DENO_NO_PROMPT variable (#14209)
This commit adds support for "DENO_NO_PROMPT" env
variable, that can be used instead of "--no-prompt" flag
to completely disable permission prompts.
Diffstat (limited to 'cli/tests/integration')
| -rw-r--r-- | cli/tests/integration/bench_tests.rs | 5 | ||||
| -rw-r--r-- | cli/tests/integration/run_tests.rs | 20 | ||||
| -rw-r--r-- | cli/tests/integration/test_tests.rs | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/cli/tests/integration/bench_tests.rs b/cli/tests/integration/bench_tests.rs index 7b4fbb0a5..e889a8224 100644 --- a/cli/tests/integration/bench_tests.rs +++ b/cli/tests/integration/bench_tests.rs @@ -130,13 +130,14 @@ itest!(filter { }); itest!(no_prompt_by_default { - args: "bench --unstable bench/no_prompt_by_default.ts", + args: "bench --quiet --unstable bench/no_prompt_by_default.ts", exit_code: 1, output: "bench/no_prompt_by_default.out", }); itest!(no_prompt_with_denied_perms { - args: "bench --unstable --allow-read bench/no_prompt_with_denied_perms.ts", + args: + "bench --quiet --unstable --allow-read bench/no_prompt_with_denied_perms.ts", exit_code: 1, output: "bench/no_prompt_with_denied_perms.out", }); diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 0953e7239..b99ab2890 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2733,3 +2733,23 @@ itest!(js_root_with_ts_check { output: "js_root_with_ts_check.js.out", exit_code: 1, }); + +itest!(no_prompt_flag { + args: "run --quiet --unstable --no-prompt no_prompt.ts", + output_str: Some(""), +}); + +#[test] +fn deno_no_prompt_environment_variable() { + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("--unstable") + .arg("no_prompt.ts") + .env("DENO_NO_PROMPT", "1") + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); +} diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index bac50f16d..3e2df9113 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -288,13 +288,13 @@ itest!(steps_output_within { }); itest!(no_prompt_by_default { - args: "test test/no_prompt_by_default.ts", + args: "test --quiet 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", + args: "test --quiet --allow-read test/no_prompt_with_denied_perms.ts", exit_code: 1, output: "test/no_prompt_with_denied_perms.out", }); |
