File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,14 @@ describe('wrappedNodeFetch', () => {
2121 const updatedctx = getExecutionContext ( ) . context ;
2222 const mocks = updatedctx . mocks . length ;
2323 const deps = updatedctx . deps . length ;
24+ const responseBody = await response . text ( ) ;
25+ const recordedOutput = updatedctx . mocks [ 0 ] . Spec . Res . Body ;
2426 expect ( mockFetch ) . toHaveBeenCalledWith ( url , options ) ;
2527 expect ( response ) . toBeInstanceOf ( Response ) ;
2628 expect ( mocks ) . toBeGreaterThan ( 0 ) ;
2729 expect ( deps ) . toBeGreaterThan ( 0 ) ;
30+ expect ( response ) . toHaveProperty ( 'body' ) ;
31+ expect ( responseBody ) . toEqual ( recordedOutput ) ;
2832 } ) ;
2933
3034 it ( 'should return mocked response in test mode' , async ( ) => {
@@ -41,12 +45,12 @@ describe('wrappedNodeFetch', () => {
4145 Spec : {
4246 Metadata : {
4347 name : 'node-fetch' ,
44- url : 'http://localhost:8080 ' ,
48+ url : 'http://example.com ' ,
4549 options : { method : 'GET' } ,
4650 type : 'HTTP_CLIENT' ,
4751 } ,
4852 Req : {
49- URL : 'http://localhost:8080 ' ,
53+ URL : 'http://example.com ' ,
5054 Body : '' ,
5155 Header : { } ,
5256 Method : 'GET' ,
You can’t perform that action at this time.
0 commit comments