Skip to content

Commit

Permalink
cover GET handler in test
Browse files Browse the repository at this point in the history
  • Loading branch information
edivados committed Sep 1, 2023
1 parent cee998d commit da5a4a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/api-routes-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test.describe("api routes", () => {
export default function Page() { return <div>page</div>; }
`,
"src/routes/api/method-not-found.js": js`
export function GET () { return new Response(); }
export function POST () { return new Response(); }
`
}
});
Expand Down Expand Up @@ -294,8 +294,8 @@ test.describe("api routes", () => {
})
});

test("should return 405 for undefined handlers on route with only a GET export", async () => {
["POST", "PUT", "PATCH", "DELETE"].forEach(async method => {
test("should return 405 for undefined handlers on route with only a POST export", async () => {
["GET", "PUT", "PATCH", "DELETE"].forEach(async method => {
let res = await fixture.requestDocument("/api/method-not-found", { method });
expect(res.status).toEqual(405);
});
Expand Down

0 comments on commit da5a4a8

Please sign in to comment.