Skip to content

Commit

Permalink
Merge pull request #3217 from snyk/test/v2-tempdir
Browse files Browse the repository at this point in the history
test(v2): use go testing tempdir
  • Loading branch information
Jahed Ahmed authored May 10, 2022
2 parents fde85d1 + aac4613 commit e994c42
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cliv2/test/testlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,11 @@ func SetupTestProject(t *testing.T) *TestProject {
t.Log("snykCLIPath:", snykCLIPath)

snykCLIFilename := path.Base(snykCLIPath)
tempDirForTest, err := os.MkdirTemp("", "snyk-cliv2-test-")
if err != nil {
t.Fatal(err)
}
tempDirForTest := t.TempDir()

targetSnykCLIPath := path.Join(tempDirForTest, snykCLIFilename)
t.Log("targetSnykCLIPath:", targetSnykCLIPath)
err = copyFile(snykCLIPath, targetSnykCLIPath)
err := copyFile(snykCLIPath, targetSnykCLIPath)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit e994c42

Please sign in to comment.