diff options
Diffstat (limited to 'cli/tests/repl_tests.rs')
-rw-r--r-- | cli/tests/repl_tests.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cli/tests/repl_tests.rs b/cli/tests/repl_tests.rs index a5c64f3b6..d64871bb0 100644 --- a/cli/tests/repl_tests.rs +++ b/cli/tests/repl_tests.rs @@ -940,7 +940,7 @@ mod repl { true, vec!["repl", "--quiet", "--allow-read", "--allow-env"], Some(vec![r#"export {} from "npm:chalk";"#]), - Some(env_vars), + Some(env_vars.clone()), true, ); @@ -948,5 +948,21 @@ mod repl { assert_contains!(out, "Chalk: [Function: Chalk],"); assert!(err.is_empty()); } + + { + let (out, err) = util::run_and_collect_output_with_args( + true, + vec!["repl", "--quiet", "--allow-read", "--allow-env"], + Some(vec![r#"import foo from "npm:asdfawe52345asdf""#]), + Some(env_vars), + true, + ); + + assert_contains!( + out, + "error: npm package 'asdfawe52345asdf' does not exist" + ); + assert!(err.is_empty()); + } } } |