Skip to content

Commit 6a43c91

Browse files
committed
chore: improve test fragile root dep lookup
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent d151586 commit 6a43c91

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/providers/golang_gomodules.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ suite('testing the golang-go-modules data provider', () => {
6161
test('verify go_mod_no_ignore component analysis includes all root-level deps from go mod graph', async () => {
6262
let providedData = await golangGoModules.provideComponent('test/providers/tst_manifests/golang/go_mod_no_ignore/go.mod')
6363
let sbom = JSON.parse(providedData.content)
64-
let rootDeps = sbom.dependencies.find(d => d.dependsOn && d.dependsOn.length > 0)
64+
let rootRef = sbom.metadata.component.purl
65+
let rootDeps = sbom.dependencies.find(d => d.ref === rootRef)
6566
expect(rootDeps.dependsOn).to.have.lengthOf(45,
6667
'Component analysis should include all root-level edges from go mod graph as direct deps. ' +
6768
'A lower count indicates the directDepPaths filtering is incorrectly excluding indirect require entries.')

0 commit comments

Comments
 (0)