diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-11-14 11:58:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 16:58:06 +0000 |
commit | d342c0df71bd3da75330af3dbf2949e8dab36c2b (patch) | |
tree | ca3c9eaffe53b51b8865037ab8bd7d0b53b94e92 /cli/tests/integration/cache_tests.rs | |
parent | eab755501394ef3cce120955223de5c6447bd87d (diff) |
chore: switch compile tests over to the TestBuilder (#21180)
Diffstat (limited to 'cli/tests/integration/cache_tests.rs')
-rw-r--r-- | cli/tests/integration/cache_tests.rs | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/cli/tests/integration/cache_tests.rs b/cli/tests/integration/cache_tests.rs index 3d387f15e..04ec447c4 100644 --- a/cli/tests/integration/cache_tests.rs +++ b/cli/tests/integration/cache_tests.rs @@ -57,28 +57,23 @@ itest!(ignore_require { // which is only used on linux. #[cfg(target_os = "linux")] #[test] -fn relative_home_dir() { - use test_util as util; - use test_util::TempDir; - - let deno_dir = TempDir::new(); - let mut deno_cmd = util::deno_cmd(); - let output = deno_cmd - .current_dir(util::testdata_path()) - .env("XDG_CACHE_HOME", deno_dir.path()) +fn xdg_cache_home_dir() { + let context = TestContext::with_http_server(); + let deno_dir = context.temp_dir(); + let xdg_cache_home = deno_dir.path().join("cache"); + context + .new_command() .env_remove("HOME") .env_remove("DENO_DIR") - .arg("cache") - .arg("--reload") - .arg("--no-check") - .arg("run/002_hello.ts") - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - assert!(output.status.success()); - assert_eq!(output.stdout, b""); + .env_clear() + .env("XDG_CACHE_HOME", &xdg_cache_home) + .args( + "cache --reload --no-check http://localhost:4548/subdir/redirects/a.ts", + ) + .run() + .skip_output_check() + .assert_exit_code(0); + assert!(xdg_cache_home.read_dir().count() > 0); } itest!(check_local_by_default { |