Skip to content

Commit

Permalink
test: add test with empty resolved fields for link
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Jun 5, 2024
1 parent 70a3287 commit a2d1871
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/dependency/parser/nodejs/npm/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ func TestParse(t *testing.T) {
want: npmV3WithoutRootDepsField,
wantDeps: npmV3WithoutRootDepsFieldDeps,
},
{
name: "lock version v3 with broken link",
file: "testdata/package-lock_v3_broken_link.json",
want: nil,
wantDeps: nil,
},
}

for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "node_v3_without_direct_deps",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "node_v3_without_direct_deps",
"version": "1.0.0",
"license": "ISC"
},
"functions/func1": {
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"debug": "^2.6.9"
}
},
"node_modules/func1": {
"resolved": "",
"link": true
}
}
}

0 comments on commit a2d1871

Please sign in to comment.