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 <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman 2026-08-20 16:01:52 -04:00 committed by GitHub
parent 490732aa58
commit 168eb64235
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")