diff --git a/src/controllers/__tests__/delivery.test.ts b/src/controllers/__tests__/delivery.test.ts index b601ff756c..3f88855133 100644 --- a/src/controllers/__tests__/delivery.test.ts +++ b/src/controllers/__tests__/delivery.test.ts @@ -175,7 +175,7 @@ describe('Delivery controller tests', () => { response: [{ error: 'test error', metadata: { a1: 'b1' }, statusCode: 500 }], }, }; - expect(response.status).toEqual(500); + expect(response.status).toEqual(200); expect(response.body).toEqual(expectedResp); expect(response.header['apiversion']).toEqual('2'); diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index f68b627e9b..266619b6ac 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -241,8 +241,9 @@ describe('Api tests with a mock source/destination', () => { return { response: 'response', status: 200 }; }), responseHandler: jest.fn((o, d) => { - expect(o).toEqual({ response: 'response', status: 200, rudderJobMetadata: { a1: 'b1' } }); - expect(d).toEqual(destType); + expect(o.destinationResponse).toEqual({ response: 'response', status: 200 }); + expect(o.rudderJobMetadata).toEqual({ a1: 'b1' }); + expect(o.destType).toEqual(destType); return { status: 200, message: 'response', destinationResponse: 'response' }; }), }; @@ -301,8 +302,9 @@ describe('Api tests with a mock source/destination', () => { return { response: 'response', status: 200 }; }), responseHandler: jest.fn((o, d) => { - expect(o).toEqual({ response: 'response', status: 200, rudderJobMetadata: [{ a1: 'b1' }] }); - expect(d).toEqual(destType); + expect(o.destinationResponse).toEqual({ response: 'response', status: 200 }); + expect(o.rudderJobMetadata).toEqual([{ a1: 'b1' }]); + expect(o.destType).toEqual(destType); return respHandlerResponse; }), };