From 168eb64235165003299c85090d3265a674ffc67f Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Thu, 20 Aug 2026 16:01:52 -0400 Subject: [PATCH] fix(javascript): pass a yaml node to the pnpm v5 collision test (#5203) #5188 changed `pnpmV6LockYaml.Parse` to take a `*yaml.Node` and #5175 added this test against the old `[]byte` signature. both were green on their own branches, so main does not compile. the v9 and v6 cases in the same test already go through the `yamlDocument` helper, this is just the v5 one that was missed. Signed-off-by: Alex Goodman --- syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go b/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go index 700603ee3..35c8e0555 100644 --- a/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go +++ b/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go @@ -654,18 +654,18 @@ packages: } // v5 lockfile with two entries that collapse to the same key (underscore peer-dep suffixes) - lockfileV5 := []byte(` + lockfileV5 := ` lockfileVersion: 5.4 packages: /some-pkg/1.0.0_peer-b@2.0.0: resolution: {integrity: sha512-BBB} /some-pkg/1.0.0_peer-a@1.0.0: resolution: {integrity: sha512-AAA} -`) +` for range 10 { parser := &pnpmV6LockYaml{} - pkgs, err := parser.Parse(5.4, lockfileV5) + pkgs, err := parser.Parse(5.4, yamlDocument(t, lockfileV5)) require.NoError(t, err) require.Len(t, pkgs, 1, "expected exactly one package after key collision")