summaryrefslogtreecommitdiff
path: root/cli/tests/integration/bundle_tests.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-08-29 14:24:10 -0400
committerGitHub <noreply@github.com>2022-08-29 14:24:10 -0400
commitc3e48cba184f2f8aaf3d30196b674c8a7dd8449b (patch)
tree4001dc9a30abbcf370971931891c0cf59aba4a2d /cli/tests/integration/bundle_tests.rs
parentb62ef4d37bc1207abb2daed5e2568eb581f07aa2 (diff)
fix(compile): panic when running with a populated dep analysis cache (#15672)
Closes #15612
Diffstat (limited to 'cli/tests/integration/bundle_tests.rs')
-rw-r--r--cli/tests/integration/bundle_tests.rs36
1 files changed, 20 insertions, 16 deletions
diff --git a/cli/tests/integration/bundle_tests.rs b/cli/tests/integration/bundle_tests.rs
index dd83f0a95..a2e529000 100644
--- a/cli/tests/integration/bundle_tests.rs
+++ b/cli/tests/integration/bundle_tests.rs
@@ -93,25 +93,29 @@ fn bundle_exports_no_check() {
#[test]
fn bundle_circular() {
// First we have to generate a bundle of some module that has exports.
- let circular1 = util::testdata_path().join("subdir/circular1.ts");
- assert!(circular1.is_file());
+ let circular1_path = util::testdata_path().join("subdir/circular1.ts");
+ assert!(circular1_path.is_file());
let t = TempDir::new();
- let bundle = t.path().join("circular1.bundle.js");
- let mut deno = util::deno_cmd()
- .current_dir(util::testdata_path())
- .arg("bundle")
- .arg(circular1)
- .arg(&bundle)
- .spawn()
- .unwrap();
- let status = deno.wait().unwrap();
- assert!(status.success());
- assert!(bundle.is_file());
-
- let output = util::deno_cmd()
+ let bundle_path = t.path().join("circular1.bundle.js");
+
+ // run this twice to ensure it works even when cached
+ for _ in 0..2 {
+ let mut deno = util::deno_cmd_with_deno_dir(&t)
+ .current_dir(util::testdata_path())
+ .arg("bundle")
+ .arg(&circular1_path)
+ .arg(&bundle_path)
+ .spawn()
+ .unwrap();
+ let status = deno.wait().unwrap();
+ assert!(status.success());
+ assert!(bundle_path.is_file());
+ }
+
+ let output = util::deno_cmd_with_deno_dir(&t)
.current_dir(util::testdata_path())
.arg("run")
- .arg(&bundle)
+ .arg(&bundle_path)
.output()
.unwrap();
// check the output of the the bundle program.