Skip to content

Commit

Permalink
build: Fix up integration test API (#30)
Browse files Browse the repository at this point in the history
Some quick fixes to the integration test API for some new upcoming tests.
  • Loading branch information
nicholas-codecov authored Dec 15, 2023
1 parent 1d258a6 commit 7fc27b3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions integration-tests/test-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => c.text("Hello Hono!"));

app.all(
"/:status{[0-9]{3}}/upload/bundle_analysis/v1/:badPUT{true|false}",
"/test-url/:status/:badPUT{true|false}/upload/bundle_analysis/v1",
(c) => {
const status = parseInt(c.req.param("status"));
const badPUT = c.req.param("badPUT") === "true";
const url = new URL(c.req.url);
let putURL = `${url.protocol}//${url.host}/file-upload`;

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

const url = new URL(c.req.url);
let putURL = `${url.protocol}//${url.host}/file-upload`;

if (badPUT) {
putURL = `${putURL}/${status}`;
}
Expand Down

0 comments on commit 7fc27b3

Please sign in to comment.