Skip to content

Commit ccc3405

Browse files
committed
test: update bad method test
it now throws a TypeError Signed-off-by: Logan McAnsh <logan@mcan.sh>
1 parent 1163187 commit ccc3405

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

integration/error-data-request-test.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,13 @@ test.describe("ErrorBoundary", () => {
129129
});
130130

131131
test("returns a 405 x-remix-error on a data fetch with a bad method", async () => {
132-
let response = await fixture.requestData(
133-
`/loader-return-json`,
134-
"routes/loader-return-json",
135-
{
132+
expect(() =>
133+
fixture.requestData("/loader-return-json", "routes/loader-return-json", {
136134
method: "TRACE",
137-
}
135+
})
136+
).rejects.toThrowError(
137+
`Failed to construct 'Request': 'TRACE' HTTP method is unsupported.`
138138
);
139-
expect(response.status).toBe(405);
140-
expect(response.headers.get("X-Remix-Error")).toBe("yes");
141-
expect(await response.text()).toMatch("Unexpected Server Error");
142-
assertConsoleError('Error: Invalid request method "TRACE"');
143139
});
144140

145141
test("returns a 403 x-remix-error on a data fetch GET to a bad path", async () => {

0 commit comments

Comments
 (0)