File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/rsocket-router/tests/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,21 @@ import { WebsocketServerTransport } from '../../src/router/transport/WebSocketSe
7
7
import { WebsocketDuplexConnection } from '../../src/router/transport/WebsocketDuplexConnection.js' ;
8
8
import { Duplex } from 'stream' ;
9
9
10
- const WS_PORT = process . env . WS_PORT ? parseInt ( process . env . WS_PORT ) : 4532 ;
11
- const WS_ADDRESS = `ws://localhost:${ WS_PORT } ` ;
10
+ let nextPort = 5433 ;
12
11
13
12
describe ( 'Sockets' , ( ) => {
14
13
let server : WebSocket . WebSocketServer ;
15
14
let closeServer : ( ) => void ;
16
15
16
+ let WS_PORT = 0 ;
17
+ let WS_ADDRESS = '' ;
18
+
17
19
beforeEach ( ( ) => {
18
20
let closed = false ;
21
+
22
+ WS_PORT = process . env . WS_PORT ? parseInt ( process . env . WS_PORT ) : nextPort ++ ;
23
+ WS_ADDRESS = `ws://localhost:${ WS_PORT } ` ;
24
+
19
25
server = new WebSocket . WebSocketServer ( {
20
26
port : WS_PORT
21
27
} ) ;
You can’t perform that action at this time.
0 commit comments