From d3af249acb736ed66dcf26a4f919c84479c9bbbb Mon Sep 17 00:00:00 2001 From: Eyal Mizrachi <145741922+Eyalm321@users.noreply.github.com> Date: Fri, 15 May 2026 07:11:26 -0400 Subject: [PATCH] test(deps-restorer): complete the peer-variant-missing-resolution fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fixture's lockfile was minimal — it had the pkg-a base + peer-variant entries (the shape that triggered the original `'directory' in undefined` TypeError in graph-builder) but no `peer@1.0.0` entry. That was enough before Bug 1's fix, because graph-builder crashed early. Now that the graph-builder + helper changes let the install path proceed, the next stage (`filterLockfileByImportersAndEngine`) walks the dependency graph and throws `LockfileMissingDependencyError: no entry for 'peer@1.0.0'`. Add a stub directory-resolution entry pointing at the existing `packages/peer/` workspace package so the graph walker finds it. --- .../peer-variant-missing-resolution/pnpm-lock.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/installing/deps-restorer/test/fixtures/peer-variant-missing-resolution/pnpm-lock.yaml b/installing/deps-restorer/test/fixtures/peer-variant-missing-resolution/pnpm-lock.yaml index 367a2ecfb7..c60fe63db5 100644 --- a/installing/deps-restorer/test/fixtures/peer-variant-missing-resolution/pnpm-lock.yaml +++ b/installing/deps-restorer/test/fixtures/peer-variant-missing-resolution/pnpm-lock.yaml @@ -36,6 +36,14 @@ packages: dependencies: peer: 1.0.0 + # Peer dep resolved to the workspace `packages/peer/` directory. This + # entry is required for `filterLockfileByImportersAndEngine` to walk + # the graph past the variant entry — otherwise it throws + # `LockfileMissingDependencyError` once the graph-builder no longer + # crashes early on the missing `resolution`. + 'peer@1.0.0': + resolution: { directory: packages/peer, type: directory } + snapshots: 'pkg-a@file:packages/pkg-a': {} @@ -43,3 +51,5 @@ snapshots: 'pkg-a@file:packages/pkg-a(peer@1.0.0)': dependencies: peer: 1.0.0 + + 'peer@1.0.0': {}