Skip to content

Commit a0b6de1

Browse files
committed
update path
1 parent bc43724 commit a0b6de1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

crates/vite_task_graph/tests/snapshots.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ fn snapshot_execution_graph(
106106
execution_node_snapshots
107107
}
108108

109+
/// Modify absolute paths to be stable across different tmpdir locations.
109110
fn stabilize_absolute_path(path: &mut Arc<AbsolutePath>, base_dir: &AbsolutePath) {
110111
let relative_path = path.strip_prefix(base_dir).unwrap().unwrap();
111-
let new_base_dir =
112-
AbsolutePath::new(if cfg!(windows) { "C:\\workspace" } else { "/workspace" }).unwrap();
112+
// this path is considered absolute on all platforms
113+
let new_base_dir = AbsolutePath::new("//?/workspace/").unwrap();
113114
*path = new_base_dir.join(relative_path).into();
114115
}
115116

117+
/// Modify absolute paths in the SpecifierLookupError to be stable across different tmpdir locations.
116118
fn stabilize_specifier_lookup_error(
117119
err: &mut SpecifierLookupError<PackageUnknownError>,
118120
base_dir: &AbsolutePath,

crates/vite_task_graph/tests/snapshots/snapshots__query - ambiguous task name@transitive-dependency-workspace.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ AmbiguousPackageName {
77
package_name: "@test/a",
88
package_paths: [
99
AbsolutePath(
10-
"/workspace/packages/a",
10+
"//?/workspace/packages/a",
1111
),
1212
AbsolutePath(
13-
"/workspace/packages/another-a",
13+
"//?/workspace/packages/another-a",
1414
),
1515
],
1616
}

0 commit comments

Comments
 (0)