Skip to content

Commit af4d942

Browse files
committed
test: make tests pass
1 parent c3316b3 commit af4d942

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
)
1515

1616
var (
17-
Version = "dev" //nolint:gochecknoglobals // We need this to be set at build
18-
Commit = "<none>" //nolint:gochecknoglobals // We need this to be set at build
17+
Version = "dev" //nolint:gochecknoglobals // We need this to be set at build
18+
Commit = "-" //nolint:gochecknoglobals // We need this to be set at build
1919
)
2020

2121
func main() {

main_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type TestCase struct {
3030
expectedCode int
3131
expectedBody string
3232
expectedContentType string
33-
validateFunc func(t *testing.T, response map[string]interface{})
33+
validateFunc func(t *testing.T, response map[string]any)
3434
}
3535

3636
func init() {
@@ -85,7 +85,7 @@ func runTestCases(t *testing.T, tests []TestCase) {
8585
assert.Nil(t, err)
8686

8787
if test.validateFunc != nil {
88-
var bodyMap map[string]interface{}
88+
var bodyMap map[string]any
8989
err = json.Unmarshal(body, &bodyMap)
9090
assert.Nil(t, err)
9191

@@ -121,9 +121,9 @@ func TestStatusEndpoints(t *testing.T) {
121121
tests := []TestCase{
122122
{
123123
query: "GET /v1/status",
124-
expectedCode: 204,
125-
expectedBody: "",
126-
expectedContentType: "",
124+
expectedCode: 200,
125+
expectedBody: `{"v":"dev","commit":"-"}`,
126+
expectedContentType: "application/json",
127127
// TODO: test cache headers
128128
},
129129
}

0 commit comments

Comments
 (0)