File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 "docs" : " typedoc src/index.ts" ,
3232 "lint" : " eslint ." ,
3333 "test" : " vitest run --coverage" ,
34- "test-browser" : " vitest --config ./vitest.config.browser.ts" ,
34+ "test-browser" : " VITE_WS_URL=$WS_URL vitest --config ./vitest.config.browser.ts" ,
3535 "prebuild" : " rm -rf dist lib types" ,
3636 "build" : " tsc && tsc --module commonjs --outDir lib/cjs && tsc --emitDeclarationOnly --removeComments false && rollup -c" ,
3737 "postbuild" : " echo '{\" type\" : \" commonjs\" }' > lib/cjs/package.json" ,
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ import { AMQPWebSocketClient } from '../src/amqp-websocket-client.js';
33import { AMQPMessage } from '../src/amqp-message.js' ;
44import type { AMQPError } from "../src/amqp-error.js" ;
55
6+ const WS_URL = import . meta. env . VITE_WS_URL || "ws://127.0.0.1:15670/ws/amqp"
7+
68function getNewClient ( init ?: { frameMax ?: number , heartbeat ?: number } ) : AMQPWebSocketClient {
7- return init
8- ? new AMQPWebSocketClient ( { url : "ws://127.0.0.1:15670/ws/amqp" , ...init } )
9- : new AMQPWebSocketClient ( "ws://127.0.0.1:15670/ws/amqp" )
9+ return init
10+ ? new AMQPWebSocketClient ( { url : WS_URL , ...init } )
11+ : new AMQPWebSocketClient ( WS_URL )
1012}
1113
1214beforeEach ( ( ) => {
You can’t perform that action at this time.
0 commit comments