diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-10-08 17:11:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 17:11:33 +0200 |
commit | c49a057599d68b27c88cc123a9fcd6703b49310c (patch) | |
tree | 12a4bcc8383e24453c7d235239e2c85a1180248e /cli/tests | |
parent | 6b43e862fd44044d94d5df077b30d0cb112fc4d2 (diff) |
feat(compat): inject Node globals in REPL (#12352)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/compat_tests.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/integration/compat_tests.rs b/cli/tests/integration/compat_tests.rs index 6743dada1..8f512fca3 100644 --- a/cli/tests/integration/compat_tests.rs +++ b/cli/tests/integration/compat_tests.rs @@ -1,6 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. use crate::itest; +use test_util as util; itest!(globals { args: "run --compat --unstable --allow-read --allow-env compat/globals.ts", @@ -22,3 +23,16 @@ itest!(existing_import_map { output: "compat/existing_import_map.out", exit_code: 1, }); + +#[test] +fn globals_in_repl() { + let (out, err) = util::run_and_collect_output_with_args( + true, + vec!["repl", "--compat", "--unstable", "--quiet"], + Some(vec!["global == window"]), + None, + false, + ); + assert!(out.contains("true")); + assert!(err.contains("Implicitly using latest version")); +} |