Skip to content

Commit 7fc27b3

Browse files
authored
build: Fix up integration test API (#30)
Some quick fixes to the integration test API for some new upcoming tests.
1 parent 1d258a6 commit 7fc27b3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

integration-tests/test-api/src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@ import { Hono } from "hono";
33

44
const app = new Hono();
55

6-
app.get("/", (c) => c.text("Hello Hono!"));
7-
86
app.all(
9-
"/:status{[0-9]{3}}/upload/bundle_analysis/v1/:badPUT{true|false}",
7+
"/test-url/:status/:badPUT{true|false}/upload/bundle_analysis/v1",
108
(c) => {
119
const status = parseInt(c.req.param("status"));
1210
const badPUT = c.req.param("badPUT") === "true";
11+
const url = new URL(c.req.url);
12+
let putURL = `${url.protocol}//${url.host}/file-upload`;
1313

1414
if (status >= 400 && !badPUT) {
1515
return c.text(`Error code: ${status}`, { status });
1616
}
1717

18-
const url = new URL(c.req.url);
19-
let putURL = `${url.protocol}//${url.host}/file-upload`;
20-
2118
if (badPUT) {
2219
putURL = `${putURL}/${status}`;
2320
}

0 commit comments

Comments
 (0)