summaryrefslogtreecommitdiff
path: root/cli/tests/repl_tests.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-12-07 20:21:18 +0100
committerGitHub <noreply@github.com>2022-12-07 20:21:18 +0100
commit1a472ad06bdc55b1fa0c0f26ca2d24d709f2e0c3 (patch)
tree7b1c8b615f36916744723e8d60162801eb6127a7 /cli/tests/repl_tests.rs
parent192f07bb7e2076808cae1eeb6c701cdd3d8d42cd (diff)
feat(repl): run "deno repl" with no permissions (#16795)
This commit changes "deno repl" command to run with no permissions by default and accept "--allow-*" flags. This change is dictated by the fact that currently there is no way to run REPL with limited permissions. Technically it's a breaking change in the CLI command, but there's agreement in the team that it has merit and it's a good solution. Running just "deno" command still starts the REPL with full permissions allowed, but now a banner is printed to inform users about that:
Diffstat (limited to 'cli/tests/repl_tests.rs')
-rw-r--r--cli/tests/repl_tests.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/tests/repl_tests.rs b/cli/tests/repl_tests.rs
index 136148d9f..4524b4097 100644
--- a/cli/tests/repl_tests.rs
+++ b/cli/tests/repl_tests.rs
@@ -460,9 +460,9 @@ mod repl {
#[test]
fn import() {
- let (out, _) = util::run_and_collect_output(
+ let (out, _) = util::run_and_collect_output_with_args(
true,
- "repl",
+ vec![],
Some(vec!["import('./subdir/auto_print_hello.ts')"]),
Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]),
false,
@@ -472,9 +472,9 @@ mod repl {
#[test]
fn import_declarations() {
- let (out, _) = util::run_and_collect_output(
+ let (out, _) = util::run_and_collect_output_with_args(
true,
- "repl",
+ vec!["repl", "--allow-read"],
Some(vec!["import './subdir/auto_print_hello.ts';"]),
Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]),
false,
@@ -796,7 +796,7 @@ mod repl {
fn eval_file_flag_multiple_files() {
let (out, err) = util::run_and_collect_output_with_args(
true,
- vec!["repl", "--eval-file=http://127.0.0.1:4545/repl/import_type.ts,./tsc/d.ts,http://127.0.0.1:4545/type_definitions/foo.js"],
+ vec!["repl", "--allow-read", "--eval-file=http://127.0.0.1:4545/repl/import_type.ts,./tsc/d.ts,http://127.0.0.1:4545/type_definitions/foo.js"],
Some(vec!["b.method1=v4", "b.method1()+foo.toUpperCase()"]),
None,
true,