Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 committed Sep 28, 2024
1 parent 46db9bf commit 7cbef04
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/iac/scanners/terraform/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1192,4 +1192,28 @@ resource "aws_iam_policy" "bad_configuration" {
assert.Empty(t, results)
})

t.Run("non existing value for skip-files option", func(t *testing.T) {
scanner := New(
options.ScannerWithIncludeDeprecatedChecks(true),
ScannerWithSkipFiles([]string{"foo/bar*.tf"}),
ScannerWithAllDirectories(true),
)

results, err := scanner.ScanFS(context.TODO(), fs, "deployments")
require.NoError(t, err)

assert.Equal(t, 4, len(results))

Check failure on line 1205 in pkg/iac/scanners/terraform/scanner_test.go

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest)

len: use assert.Len (testifylint)
})

t.Run("empty skip-files option", func(t *testing.T) {
scanner := New(
options.ScannerWithIncludeDeprecatedChecks(true),
ScannerWithAllDirectories(true),
)

results, err := scanner.ScanFS(context.TODO(), fs, "deployments")
require.NoError(t, err)

assert.Equal(t, 4, len(results))

Check failure on line 1217 in pkg/iac/scanners/terraform/scanner_test.go

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest)

len: use assert.Len (testifylint)
})
}

0 comments on commit 7cbef04

Please sign in to comment.