Skip to content

Commit

Permalink
Update test to verify validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Broadbent committed Dec 7, 2023
1 parent acb0391 commit dd7a747
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("route", () => {
})
})

describe("when invalid route is posted in body", () => {
describe("when body of request fails validation for route", () => {
let response: LightMyRequestResponse

beforeAll(async () => {
Expand All @@ -115,6 +115,8 @@ describe("route", () => {
url: "/v1/route",
body: {
from: "foo",
to: "bar",
miles: -400,
},
})
})
Expand All @@ -126,7 +128,7 @@ describe("route", () => {
it("should return JSON body with error message", () => {
expect(response.json()).toMatchObject({
status: 400,
message: "body must have required property 'to'",
message: "body/miles must be >= 0",
})
})
})
Expand Down

0 comments on commit dd7a747

Please sign in to comment.