Skip to content

Commit

Permalink
chore: more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandra shekar Varkala committed Feb 22, 2024
1 parent 57ddc26 commit ac995d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/controllers/__tests__/delivery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
10 changes: 6 additions & 4 deletions test/apitests/service.api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
}),
};
Expand Down Expand Up @@ -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;
}),
};
Expand Down

0 comments on commit ac995d2

Please sign in to comment.