Skip to content

Commit fc703e6

Browse files
committed
Port #851: fix vex alias tests after #605
main is red: since the store-copy change (#605) the npm resolver already returns alias and nested-store copies, so two vex_consumed tests that assumed an alias-free set fail on main and on this branch. Same change as #851; it no-ops once main carries it. Refs #335 Assisted-by: Claude Code:claude-opus-5-5
1 parent 78a8cf6 commit fc703e6

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎crates/socket-patch-cli/src/commands/vex_consumed.rs‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,11 @@ mod tests {
715715
None,
716716
)
717717
.await;
718-
assert_eq!(installed_again, installed);
719-
let (paths, calls) = tracked_npm_hosted(&common, &installed_again).await;
718+
// Since #605 the name-keyed resolver probes bundled trees itself, so
719+
// it already returns the aliases and the nested store's peers. Feed
720+
// the earlier, alias-free set to keep exercising alias expansion;
721+
// the resolver's own set is checked against the same result below.
722+
let (paths, calls) = tracked_npm_hosted(&common, &installed).await;
720723
assert_eq!(calls.len(), 1);
721724
let mut inputs = calls[0].clone();
722725
inputs.sort();
@@ -738,6 +741,9 @@ mod tests {
738741
.len(),
739742
paths.len()
740743
);
744+
let (mut resolved, _) = tracked_npm_hosted(&common, &installed_again).await;
745+
resolved.sort();
746+
assert_eq!(resolved, expected, "the resolver's own copy set");
741747
}
742748

743749
#[cfg(unix)]
@@ -768,14 +774,19 @@ mod tests {
768774
None,
769775
)
770776
.await;
771-
assert!(installed.is_empty(), "{installed:?}");
772-
let (mut paths, calls) = tracked_npm_hosted(&common, &installed).await;
777+
// Since #605 the name-keyed resolver reaches the alias and its
778+
// sibling peers on its own. An alias-only set (what an alias-blind
779+
// resolver returns) must still expand to the same copies.
780+
let (mut paths, calls) = tracked_npm_hosted(&common, &HashMap::new()).await;
773781
assert_eq!(calls, vec![vec![alias.clone()]]);
774782
let mut expected = peers;
775783
expected.push(alias);
776784
paths.sort();
777785
expected.sort();
778786
assert_eq!(paths, expected);
787+
let (mut resolved, _) = tracked_npm_hosted(&common, &installed).await;
788+
resolved.sort();
789+
assert_eq!(resolved, expected, "the resolver's own copy set");
779790
}
780791

781792
#[cfg(unix)]

0 commit comments

Comments
 (0)