mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Add test for package.json license object
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
parent
dad1d9691c
commit
624a090631
@ -30,6 +30,23 @@ func TestParsePackageJSON(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Fixture: "test-fixtures/pkg-json/package-license-object.json",
|
||||||
|
ExpectedPkg: pkg.Package{
|
||||||
|
Name: "npm",
|
||||||
|
Version: "6.14.6",
|
||||||
|
Type: pkg.NpmPkg,
|
||||||
|
Licenses: []string{"ISC"},
|
||||||
|
Language: pkg.JavaScript,
|
||||||
|
MetadataType: pkg.NpmPackageJSONMetadataType,
|
||||||
|
Metadata: pkg.NpmPackageJSONMetadata{
|
||||||
|
Author: "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
||||||
|
Homepage: "https://docs.npmjs.com/",
|
||||||
|
URL: "https://github.com/npm/cli",
|
||||||
|
Licenses: []string{"ISC"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Fixture: "test-fixtures/pkg-json/package-nested-author.json",
|
Fixture: "test-fixtures/pkg-json/package-nested-author.json",
|
||||||
ExpectedPkg: pkg.Package{
|
ExpectedPkg: pkg.Package{
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"version": "6.14.6",
|
||||||
|
"name": "npm",
|
||||||
|
"description": "a package manager for JavaScript",
|
||||||
|
"homepage": "https://docs.npmjs.com/",
|
||||||
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/npm/cli"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://npm.community/c/bugs"
|
||||||
|
},
|
||||||
|
"main": "./lib/npm.js",
|
||||||
|
"license": {
|
||||||
|
"type" : "ISC",
|
||||||
|
"url" : "https://opensource.org/licenses/ISC"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "6 >=6.2.0 || 8 || >=9.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user