@@ -116,13 +116,24 @@ describe('find', () => {
116116 } ,
117117 ) ;
118118 expect ( exitCode ) . toBe ( 0 ) ;
119- expect ( JSON . parse ( stdout ) ) . toEqual ( {
119+ const output = JSON . parse ( stdout ) ;
120+ expect ( output ) . toMatchObject ( {
120121 success : true ,
121- message : `Found node at ${ remoteOnlineHost } :${ remoteOnlinePort } ` ,
122122 id : nodesUtils . encodeNodeId ( remoteOnlineNodeId ) ,
123- host : remoteOnlineHost ,
124- port : remoteOnlinePort ,
125123 } ) ;
124+ expect ( output . addresses ) . toEqual (
125+ expect . arrayContaining ( [
126+ {
127+ host : remoteOnlineHost ,
128+ port : remoteOnlinePort ,
129+ } ,
130+ ] ) ,
131+ ) ;
132+ expect ( output . message ) . toMatch (
133+ new RegExp (
134+ `Found node at .*?${ remoteOnlineHost } :${ remoteOnlinePort } .*?` ,
135+ ) ,
136+ ) ;
126137 } ,
127138 ) ;
128139 testUtils . testIf ( testUtils . isTestPlatformEmpty ) (
@@ -145,13 +156,24 @@ describe('find', () => {
145156 } ,
146157 ) ;
147158 expect ( exitCode ) . toBe ( 0 ) ;
148- expect ( JSON . parse ( stdout ) ) . toEqual ( {
159+ const output = JSON . parse ( stdout ) ;
160+ expect ( output ) . toMatchObject ( {
149161 success : true ,
150- message : `Found node at ${ remoteOfflineHost } :${ remoteOfflinePort } ` ,
151162 id : nodesUtils . encodeNodeId ( remoteOfflineNodeId ) ,
152- host : remoteOfflineHost ,
153- port : remoteOfflinePort ,
154163 } ) ;
164+ expect ( output . addresses ) . toEqual (
165+ expect . arrayContaining ( [
166+ {
167+ host : remoteOfflineHost ,
168+ port : remoteOfflinePort ,
169+ } ,
170+ ] ) ,
171+ ) ;
172+ expect ( output . message ) . toMatch (
173+ new RegExp (
174+ `Found node at .*?${ remoteOfflineHost } :${ remoteOfflinePort } .*?` ,
175+ ) ,
176+ ) ;
155177 } ,
156178 ) ;
157179 testUtils . testIf ( testUtils . isTestPlatformEmpty ) (
@@ -183,8 +205,7 @@ describe('find', () => {
183205 unknownNodeId ! ,
184206 ) } `,
185207 id : nodesUtils . encodeNodeId ( unknownNodeId ! ) ,
186- host : '' ,
187- port : 0 ,
208+ addresses : [ ] ,
188209 } ) ;
189210 } ,
190211 globalThis . failedConnectionTimeout ,
0 commit comments