chore(tests): test_util - Add PathRef (#19450)

This adds a new `PathRef` struct to test_util for making it easier to
work with paths in test code. I'm going to expand on this more in the
future.
This commit is contained in:
David Sherret 2023-06-10 11:09:45 -04:00 committed by GitHub
parent f3326eebd6
commit 7f15126f23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 778 additions and 719 deletions

View file

@ -1198,7 +1198,7 @@ mod tests {
location: &Path,
maybe_import_map: Option<(&str, &str)>,
) -> StateSnapshot {
let mut documents = Documents::new(location);
let mut documents = Documents::new(location.to_path_buf());
for (specifier, source, version, language_id) in fixtures {
let specifier =
resolve_url(specifier).expect("failed to create specifier");
@ -1243,7 +1243,7 @@ mod tests {
sources: &[(&str, &str, i32, LanguageId)],
maybe_import_map: Option<(&str, &str)>,
) -> (StateSnapshot, PathBuf) {
let location = temp_dir.path().join("deps");
let location = temp_dir.path().join("deps").to_path_buf();
let state_snapshot =
mock_state_snapshot(sources, &location, maybe_import_map);
(state_snapshot, location)