From f8002ae76dc99a0f8a8f986fc07c4ed03a9114af Mon Sep 17 00:00:00 2001 From: Simar Date: Sat, 28 Sep 2024 00:29:58 -0600 Subject: [PATCH] update tests --- pkg/iac/scanners/terraform/scanner_test.go | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkg/iac/scanners/terraform/scanner_test.go b/pkg/iac/scanners/terraform/scanner_test.go index 4cd4e5a9174f..e71ad09b64b3 100644 --- a/pkg/iac/scanners/terraform/scanner_test.go +++ b/pkg/iac/scanners/terraform/scanner_test.go @@ -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)) + }) }