diff options
author | VishnuJin <45007338+VishnuJin@users.noreply.github.com> | 2022-01-04 00:40:17 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 20:10:17 +0100 |
commit | d9b130410b78face988e2fa5c3939e3584bc02f7 (patch) | |
tree | b60318e27826507aab5267c28861abf13b6c1504 /cli/tests | |
parent | 340764adec4fd613239d8280664361b3c1b9d350 (diff) |
feat(compat) preload Node.js built-in modules in global vars REPL (#13127)
This commit adds preloading of built-in Node.js modules in
the REPL if running with "deno repl --compat --unstable".
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/compat_tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/integration/compat_tests.rs b/cli/tests/integration/compat_tests.rs index 714329dc2..7eff64f12 100644 --- a/cli/tests/integration/compat_tests.rs +++ b/cli/tests/integration/compat_tests.rs @@ -132,3 +132,15 @@ fn node_compat_url() { assert!(!err.is_empty()); assert!(err.contains("file:///non_existent/node/global.ts")); } + +#[test] +fn native_modules_as_global_vars() { + let (out, _err) = util::run_and_collect_output_with_args( + true, + vec!["repl", "--compat", "--unstable", "--quiet"], + Some(vec!["if(cluster && v8 && sys) { true } else { false }"]), + None, + false, + ); + assert!(out.contains("true")); +} |