Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fixed tests, i think. grep on mac has a different syntax. perhaps, we…
Browse files Browse the repository at this point in the history
… could work on this, in the future.
  • Loading branch information
Igor Shmukler committed Oct 9, 2018
1 parent d908133 commit afd95bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions analyzer/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

func TestHelloWorld(t *testing.T) {
vulns, err := Analyze("../test_data/hello-world", "", []nodepackage.Walker{})
var walker nodepackage.Walker
vulns, err := Analyze("../test_data/hello-world", "", walker)
if err != nil {
panic(err)
}
Expand All @@ -25,7 +26,8 @@ func TestHelloWorld(t *testing.T) {
}

func TestInsecureProject(t *testing.T) {
vulns, err := Analyze("../test_data/insecure-project", "", []nodepackage.Walker{})
var walker nodepackage.Walker
vulns, err := Analyze("../test_data/insecure-project", "", walker)
if err != nil {
panic(err)
}
Expand All @@ -42,12 +44,12 @@ func TestInsecureProject(t *testing.T) {
}

func TestNotExistingProject(t *testing.T) {
_, err := Analyze("./does-not-exist", "", []nodepackage.Walker{})
var walker nodepackage.Walker
_, err := Analyze("./does-not-exist", "", walker)
if err == nil {
t.Errorf("TestNotExistingProject: ./does-not-exist does not exist, it should not be analyzed !")
}
if diff := cmp.Diff(err.Error(), "could not find any dependencies and all strategies to find them failed"); diff != "" {
t.Errorf("TestNotExistingProject: err : (-got +want)\n%s", diff)
}

}
3 changes: 2 additions & 1 deletion docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ func TestCleanupInvalidFolder(t *testing.T) {
}

func TestScanImageHelloWorld(t *testing.T) {
vulns, err := ScanImage("gammaray-test-hello-world:1.0.0", "", nodepackage.Walker)
var walker nodepackage.Walker
vulns, err := ScanImage("gammaray-test-hello-world:1.0.0", "", walker)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit afd95bb

Please sign in to comment.