Skip to content

Commit

Permalink
Added integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
checkmarx-kobi-hagmi committed Apr 15, 2024
1 parent a392cb3 commit 2d6d5fb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/integration/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"testing"

"github.com/checkmarx/ast-cli/internal/commands/util/printer"
applicationErrors "github.com/checkmarx/ast-cli/internal/errors"
"github.com/checkmarx/ast-cli/internal/params"
"github.com/checkmarx/ast-cli/internal/wrappers"
"gotest.tools/assert"
Expand All @@ -33,6 +34,18 @@ func TestResultsExitCode_OnSuccessfulScan_PrintResultsForAllScanners(t *testing.
err, _ := executeCommand(t, args...)
assert.NilError(t, err)
}

func TestResultsExitCode_NoScanIdSent_FailCommandWithError(t *testing.T) {
_, _ = getRootScan(t)

args := []string{
"results", "exit-code",
flag(params.ScanTypes), "sast",
}

err, _ := executeCommand(t, args...)
assert.ErrorContains(t, err, applicationErrors.ScanIDRequired)
}
func TestResultListJson(t *testing.T) {

assertRequiredParameter(t, "Please provide a scan ID", "results", "show")
Expand Down

0 comments on commit 2d6d5fb

Please sign in to comment.