Skip to content

Commit 12d0317

Browse files
authored
refactor(template): remove unused test (#1861)
1 parent c3aca15 commit 12d0317

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

pkg/report/template_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"time"
88

99
"github.com/stretchr/testify/assert"
10-
"github.com/stretchr/testify/require"
1110

1211
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
1312
"github.com/aquasecurity/trivy/pkg/report"
@@ -185,40 +184,3 @@ func TestReportWriter_Template(t *testing.T) {
185184
})
186185
}
187186
}
188-
189-
func TestReportWriter_Template_SARIF(t *testing.T) {
190-
testCases := []struct {
191-
name string
192-
target string
193-
detectedVulns []types.DetectedVulnerability
194-
want string
195-
}{
196-
//TODO: refactor tests
197-
}
198-
for _, tc := range testCases {
199-
t.Run(tc.name, func(t *testing.T) {
200-
templateFile := "../../contrib/sarif.tpl"
201-
got := bytes.Buffer{}
202-
203-
template, err := os.ReadFile(templateFile)
204-
require.NoError(t, err, tc.name)
205-
206-
inputReport := types.Report{
207-
Results: types.Results{
208-
{
209-
Target: tc.target,
210-
Type: "footype",
211-
Vulnerabilities: tc.detectedVulns,
212-
},
213-
},
214-
}
215-
err = report.Write(inputReport, report.Option{
216-
Format: "template",
217-
Output: &got,
218-
OutputTemplate: string(template),
219-
})
220-
assert.NoError(t, err)
221-
assert.JSONEq(t, tc.want, got.String(), tc.name)
222-
})
223-
}
224-
}

0 commit comments

Comments
 (0)