diff options
Diffstat (limited to 'cli/tests/integration/compile_tests.rs')
-rw-r--r-- | cli/tests/integration/compile_tests.rs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 2f75659cf..a3f2e8697 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -479,3 +479,52 @@ fn skip_rebundle() { assert!(output.status.success()); assert_eq!(output.stdout, "Hello World\n".as_bytes()); } + +#[test] +fn check_local_by_default() { + let _guard = util::http_server(); + let dir = TempDir::new(); + let exe = if cfg!(windows) { + dir.path().join("welcome.exe") + } else { + dir.path().join("welcome") + }; + let status = util::deno_cmd() + .current_dir(util::root_path()) + .arg("compile") + .arg("--unstable") + .arg("--output") + .arg(&exe) + .arg(util::testdata_path().join("./compile/check_local_by_default.ts")) + .status() + .unwrap(); + assert!(status.success()); +} + +#[test] +fn check_local_by_default2() { + let _guard = util::http_server(); + let dir = TempDir::new(); + let exe = if cfg!(windows) { + dir.path().join("welcome.exe") + } else { + dir.path().join("welcome") + }; + let output = util::deno_cmd() + .current_dir(util::root_path()) + .env("NO_COLOR", "1") + .arg("compile") + .arg("--unstable") + .arg("--output") + .arg(&exe) + .arg(util::testdata_path().join("./compile/check_local_by_default2.ts")) + .output() + .unwrap(); + assert!(!output.status.success()); + let stdout = String::from_utf8(output.stdout).unwrap(); + let stderr = String::from_utf8(output.stderr).unwrap(); + assert!(stdout.is_empty()); + assert!(stderr.contains( + r#"error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'."# + )); +} |