diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2023-02-01 16:37:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-01 16:37:05 -0500 |
| commit | dc854e83a4bd7c1726532502595948f604f0edc1 (patch) | |
| tree | 1299eace805b8b66e389c6fb626a2acd44faff97 /cli/tests | |
| parent | f6f76a76b2b06c6546bb00117e61f4c743d1eba6 (diff) | |
fix(repl): handle @types/node not being cached in the repl (#17617)
Closes #17599
Diffstat (limited to 'cli/tests')
| -rw-r--r-- | cli/tests/integration/repl_tests.rs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index 30d91bc1c..f69f71398 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -4,6 +4,7 @@ use test_util as util; use test_util::assert_contains; use test_util::assert_ends_with; use test_util::assert_not_contains; +use util::TempDir; #[test] fn pty_multiline() { @@ -146,7 +147,6 @@ fn pty_complete_expression() { console.write_line("close();"); let output = console.read_all_output(); assert_contains!(output, "Display all"); - assert_contains!(output, "core"); assert_contains!(output, "args"); assert_contains!(output, "exit"); assert_contains!(output, "symlink"); @@ -895,6 +895,11 @@ fn repl_with_quiet_flag() { fn npm_packages() { let mut env_vars = util::env_vars_for_npm_tests(); env_vars.push(("NO_COLOR".to_owned(), "1".to_owned())); + let temp_dir = TempDir::new(); + env_vars.push(( + "DENO_DIR".to_string(), + temp_dir.path().to_string_lossy().to_string(), + )); { let (out, err) = util::run_and_collect_output_with_args( @@ -947,7 +952,7 @@ fn npm_packages() { true, vec!["repl", "--quiet", "--allow-read", "--allow-env"], Some(vec![r#"import foo from "npm:asdfawe52345asdf""#]), - Some(env_vars), + Some(env_vars.clone()), true, ); @@ -957,4 +962,20 @@ fn npm_packages() { ); assert!(err.is_empty()); } + + { + let (out, err) = util::run_and_collect_output_with_args( + true, + vec!["repl", "--quiet", "--allow-read", "--allow-env"], + Some(vec![ + "import path from 'node:path';", + "path.isGlob('asdf') ? 'yes' : 'no'", + ]), + Some(env_vars.clone()), + true, + ); + + assert_contains!(out, "no"); + assert!(err.is_empty()); + } } |
