Skip to content

Commit

Permalink
test(proxy): remove external request to speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 1, 2023
1 parent f5a5d6b commit d4f5440
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@ describe("", () => {
});

describe("sendProxy", () => {
it("can sendProxy", async () => {
it("works", async () => {
app.use(
"/hello",
eventHandler(() => "hello")
);
app.use(
"/",
eventHandler((event) => {
return sendProxy(event, "https://example.com", { fetch });
return sendProxy(event, url + "/hello", { fetch });
})
);

const result = await request.get("/");

expect(result.text).toContain(
'a href="https://www.iana.org/domains/example">More information...</a>'
);
expect(result.text).toBe("hello");
});
});

Expand Down

0 comments on commit d4f5440

Please sign in to comment.