File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
v-next/hardhat/test/internal/builtin-plugins/node/json-rpc Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import { MockEthereumProvider } from "../../../../utils.js";
22
22
23
23
describe ( "JSON-RPC handler" , async function ( ) {
24
24
const hostname = ( await exists ( "/.dockerenv" ) ) ? "0.0.0.0" : "127.0.0.1" ;
25
- const port = 8546 ;
25
+ let port : number ;
26
26
const provider = new MockEthereumProvider ( {
27
27
eth_chainId : "0x7a69" , // 31337 in hex
28
28
plainError : ( ) => {
@@ -67,12 +67,13 @@ describe("JSON-RPC handler", async function () {
67
67
} ) ;
68
68
const server = new JsonRpcServerImplementation ( {
69
69
hostname,
70
- port,
70
+ port : 0 , // use a random port
71
71
provider,
72
72
} ) ;
73
73
74
74
before ( async function ( ) {
75
- await server . listen ( ) ;
75
+ const connection = await server . listen ( ) ;
76
+ port = connection . port ;
76
77
} ) ;
77
78
78
79
after ( async function ( ) {
You can’t perform that action at this time.
0 commit comments