Skip to content

Commit 0e0bd6c

Browse files
committed
test: remove async bypass handling from proxy options
the router does not allow sending data the way bypass did. In the router we only have the req object, so this test is removed since it is invalid (https://github.com/chimurai/http-proxy-middleware/blob/6436ffc522a3a2485c198bd2fb544db0e33e3821/src/router.ts#L7)
1 parent 18704b6 commit 0e0bd6c

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

test/server/proxy-option.test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,6 @@ const proxyOptionPathsAsProperties = [
4141
}
4242
},
4343
},
44-
{
45-
context: "/proxy/async",
46-
bypass(req, res) {
47-
if (/\/proxy\/async$/.test(req.path || req.url)) {
48-
return new Promise((resolve) => {
49-
setTimeout(() => {
50-
res.end("proxy async response");
51-
resolve(true);
52-
}, 10);
53-
});
54-
}
55-
},
56-
},
5744
{
5845
context: "/bypass-with-target",
5946
target: `http://localhost:${port1}`,
@@ -295,13 +282,6 @@ describe("proxy option", () => {
295282
expect(response.status).toBe(404);
296283
});
297284

298-
it("should wait if bypass returns promise", async () => {
299-
const response = await req.get("/proxy/async");
300-
301-
expect(response.status).toBe(200);
302-
expect(response.text).toContain("proxy async response");
303-
});
304-
305285
it("should work with the 'target' option", async () => {
306286
const response = await req.get("/bypass-with-target/foo.js");
307287

0 commit comments

Comments
 (0)