File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { HttpCode } from "../../src/common/http"
66import { proxy } from "../../src/node/proxy"
77import * as httpserver from "../utils/httpserver"
88import * as integration from "../utils/integration"
9+ import { getAvailablePort } from "../utils/helpers"
910
1011describe ( "proxy" , ( ) => {
1112 const nhooyrDevServer = new httpserver . HttpServer ( )
@@ -166,14 +167,16 @@ describe("proxy", () => {
166167// src/node/proxy.ts, you should probably add it to
167168// this test suite.
168169describe ( "proxy (standalone)" , ( ) => {
169- const PORT = 9003
170- const PROXY_PORT = 8003
171- const URL = `http://localhost:${ PORT } `
172- const PROXY_URL = `http://localhost:${ PROXY_PORT } `
170+ let URL = ""
171+ let PROXY_URL = ""
173172 let testServer : http . Server
174173 let proxyTarget : http . Server
175174
176175 beforeEach ( async ( ) => {
176+ const PORT = await getAvailablePort ( )
177+ const PROXY_PORT = await getAvailablePort ( )
178+ URL = `http://localhost:${ PORT } `
179+ PROXY_URL = `http://localhost:${ PROXY_PORT } `
177180 // Define server and a proxy server
178181 testServer = http . createServer ( ( req , res ) => {
179182 proxy . web ( req , res , {
You can’t perform that action at this time.
0 commit comments