Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 authored and nikpivkin committed Sep 30, 2024
1 parent b6cb247 commit f8002ae
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))
})

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))
})
}

0 comments on commit f8002ae

Please sign in to comment.