mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
feat: add nodejs-binary package classifier (#1296)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
func TestPackagesCmdFlags(t *testing.T) {
|
||||
hiddenPackagesImage := "docker-archive:" + getFixtureImage(t, "image-hidden-packages")
|
||||
coverageImage := "docker-archive:" + getFixtureImage(t, "image-pkg-coverage")
|
||||
nodeBinaryImage := "docker-archive:" + getFixtureImage(t, "image-node-binary")
|
||||
//badBinariesImage := "docker-archive:" + getFixtureImage(t, "image-bad-binaries")
|
||||
tmp := t.TempDir() + "/"
|
||||
|
||||
@@ -142,6 +143,15 @@ func TestPackagesCmdFlags(t *testing.T) {
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "catalog-node-js-binary",
|
||||
args: []string{"packages", "-o", "json", nodeBinaryImage},
|
||||
assertions: []traitAssertion{
|
||||
assertJsonReport,
|
||||
assertInOutput("node.js"),
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "responds-to-package-cataloger-search-options",
|
||||
args: []string{"packages", "-vv"},
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
FROM node:19-alpine3.15
|
||||
@@ -85,6 +85,7 @@ func TestPkgCoverageImage(t *testing.T) {
|
||||
definedPkgs.Remove(string(pkg.CocoapodsPkg))
|
||||
definedPkgs.Remove(string(pkg.ConanPkg))
|
||||
definedPkgs.Remove(string(pkg.HackagePkg))
|
||||
definedPkgs.Remove(string(pkg.BinaryPkg))
|
||||
|
||||
var cases []testCase
|
||||
cases = append(cases, commonTestCases...)
|
||||
@@ -206,6 +207,7 @@ func TestPkgCoverageDirectory(t *testing.T) {
|
||||
observedLanguages.Remove(pkg.UnknownLanguage.String())
|
||||
definedLanguages.Remove(pkg.UnknownLanguage.String())
|
||||
observedPkgs.Remove(string(pkg.UnknownPkg))
|
||||
definedPkgs.Remove(string(pkg.BinaryPkg))
|
||||
definedPkgs.Remove(string(pkg.UnknownPkg))
|
||||
|
||||
// for directory scans we should not expect to see any of the following package types
|
||||
|
||||
Reference in New Issue
Block a user