File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
packages/indexer-common/src/__tests__ Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -83,17 +83,21 @@ describe(SubgraphManifestResolver, () => {
83
83
if ( manifestMap . has ( cid ) ) {
84
84
res . send ( manifestMap . get ( cid ) )
85
85
} else {
86
+ console . log ( `CID not found: ${ cid } ` )
86
87
res . status ( 404 ) . send ( )
87
88
}
88
89
} )
89
90
// Start server and bind to a random port
90
- server = app . listen ( 0 , ( ) => {
91
- console . log ( `Mock server running on ${ server . address ( ) } ` )
91
+ server = await new Promise ( ( resolve , reject ) => {
92
+ const s = app . listen ( 0 , ( ) => {
93
+ const address : AddressInfo = s . address ( ) as AddressInfo
94
+ console . log ( `Mock server running on ${ address . address } :${ address . port } ` )
95
+ const serverAddress = `http://localhost:${ address . port } `
96
+ ipfs = new SubgraphManifestResolver ( serverAddress , createLogger ( { name : 'test' } ) )
97
+ resolve ( s )
98
+ } )
99
+ s . on ( 'error' , reject )
92
100
} )
93
-
94
- const address : AddressInfo = server . address ( ) as AddressInfo
95
- const serverAddress = `http://localhost:${ address . port } `
96
- ipfs = new SubgraphManifestResolver ( serverAddress , createLogger ( { name : 'test' } ) )
97
101
} )
98
102
99
103
afterAll ( async ( ) => {
You can’t perform that action at this time.
0 commit comments