diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-11-23 21:20:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 08:20:30 +1100 |
commit | 7413c96985507e7d129fef9374f560fbc2f38d7e (patch) | |
tree | d7f33a4deb180d7ff0f636ac4030249803ba7fce /cli/tests/integration/run_tests.rs | |
parent | d2c53e7f10086109dc49785a9dbc36023c28b577 (diff) |
fix(cli): don't cache .tsbuildinfo unless emitting (#12830)
Fixes #12755
Fixes #12807
Fixes #12832
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 2d96fab8f..d6a5a4c25 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2305,3 +2305,39 @@ fn issue12740() { .unwrap(); assert!(!status.success()); } + +/// Regression test for https://github.com/denoland/deno/issues/12807. +#[test] +fn issue12807() { + let mod_dir = TempDir::new().expect("tempdir fail"); + let mod1_path = mod_dir.path().join("mod1.ts"); + let mod2_path = mod_dir.path().join("mod2.ts"); + let mut deno_cmd = util::deno_cmd(); + // With a fresh `DENO_DIR`, run a module with a dependency and a type error. + std::fs::write(&mod1_path, "import './mod2.ts'; Deno.exit('0');").unwrap(); + std::fs::write(&mod2_path, "console.log('Hello, world!');").unwrap(); + let status = deno_cmd + .current_dir(util::testdata_path()) + .arg("run") + .arg(&mod1_path) + .stderr(std::process::Stdio::null()) + .stdout(std::process::Stdio::null()) + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(!status.success()); + // Fix the type error and run again. + std::fs::write(&mod1_path, "import './mod2.ts'; Deno.exit(0);").unwrap(); + let status = deno_cmd + .current_dir(util::testdata_path()) + .arg("run") + .arg(&mod1_path) + .stderr(std::process::Stdio::null()) + .stdout(std::process::Stdio::null()) + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(status.success()); +} |