Skip to content

Commit

Permalink
updated test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Mar 1, 2021
1 parent 3e4a561 commit c68bd02
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/lambda/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ func TestHandleRequest404(t *testing.T) {
assert.Equal(t, "application/json", res.Headers["Content-Type"])
assert.Equal(t, "{\n \"error\": \"Forbidden\"\n}", res.Body)
}

func TestHandleConfig(t *testing.T) {
req := &events.APIGatewayV2HTTPRequest{
RouteKey: "GET /config.json",
}

res, err := HandleRequest(*req)
assert.NoError(t, err)

assert.Equal(t, 200, res.StatusCode)
assert.Equal(t, "application/json", res.Headers["Content-Type"])
assert.JSONEq(t, res.Body, "{\"proof_of_work\":{\"address\": 27,\"organisation\":29}}")
}

0 comments on commit c68bd02

Please sign in to comment.