Skip to content

Commit ac9324c

Browse files
authored
Fix E2E tests to take into account the newly added JSON fields (#944)
1 parent ed7cad6 commit ac9324c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

integration/integration_test.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ type meta struct {
2020
Version string
2121
}
2222

23+
type result struct {
24+
Issues []issue `json:"issues"`
25+
Errors []any `json:"errors"`
26+
}
27+
28+
type issue struct {
29+
Rule any `json:"rule"`
30+
Message any `json:"message"`
31+
Range any `json:"range"`
32+
Callers any `json:"callers"`
33+
34+
// The following fields are ignored because they are added in TFLint v0.59.1.
35+
// We can uncomment this once the minimum supported version is v0.59.1+.
36+
// Fixed any `json:"fixed"`
37+
// Fixable any `json:"fixable"`
38+
}
39+
2340
func TestIntegration(t *testing.T) {
2441
cases := []struct {
2542
Name string
@@ -109,12 +126,12 @@ func TestIntegration(t *testing.T) {
109126
t.Fatal(err)
110127
}
111128

112-
var want interface{}
129+
var want result
113130
if err := json.Unmarshal(rawWant, &want); err != nil {
114131
t.Fatal(err)
115132
}
116133

117-
var got interface{}
134+
var got result
118135
if err := json.Unmarshal(stdout.Bytes(), &got); err != nil {
119136
t.Fatal(err)
120137
}

0 commit comments

Comments
 (0)