Skip to content

Commit

Permalink
fix: test_create_cache_if_dir_not_exit (#4636)
Browse files Browse the repository at this point in the history
This test doesn't remove created directory after test. It will fail on next run.
  • Loading branch information
keroxp authored Apr 6, 2020
1 parent 1e478d7 commit b9e5e4c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cli/disk_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ mod tests {

#[test]
fn test_create_cache_if_dir_not_exits() {
let cache_location = if cfg!(target_os = "windows") {
PathBuf::from(r"C:\deno_dir\foo")
} else {
PathBuf::from("~/deno_dir/foo")
};
let temp_dir = TempDir::new().unwrap();
let mut cache_location = temp_dir.path().to_owned();
assert!(fs::remove_dir(&cache_location).is_ok());
cache_location.push("foo");
assert_eq!(cache_location.is_dir(), false);
DiskCache::new(&cache_location);
assert_eq!(cache_location.is_dir(), true);
Expand Down

0 comments on commit b9e5e4c

Please sign in to comment.