Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hamitb committed Jul 4, 2019
1 parent b9a812c commit dc263d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/plugins/trace.test.js
Expand Up @@ -571,7 +571,7 @@ describe('Trace', () => {
it('should set trigger tags for APIGatewayProxy to root span', () => {
expect(tracer.rootSpan.tags['trigger.domainName']).toBe('API');
expect(tracer.rootSpan.tags['trigger.className']).toBe('AWS-APIGateway');
expect(tracer.rootSpan.tags['trigger.operationNames']).toEqual([ '1234567890.execute-api.us-west-2.amazonaws.com/prod/path/to/resource' ]);
expect(tracer.rootSpan.tags['trigger.operationNames']).toEqual([ '/{proxy+}' ]);
expect(tracer.rootSpan.tags['topology.vertex']).toBe(true);
});

Expand Down
6 changes: 5 additions & 1 deletion test/thundra-wrapper.test.js
Expand Up @@ -142,7 +142,8 @@ describe('ThundraWrapper', () => {
it('should extract error from response with valid error response', () => {
const expectedAfterInvocationData = {
error: new HttpError('Lambda returned with error response.'),
response: response
originalEvent,
response,
};
expect(thundraWrapper.executeHook).toBeCalledWith('after-invocation', expectedAfterInvocationData, true);
});
Expand All @@ -159,6 +160,7 @@ describe('ThundraWrapper', () => {
it('should extract error from response with invalid body', () => {
const expectedAfterInvocationData = {
error: new HttpError('Lambda returned with error response.'),
originalEvent,
response: response
};
expect(thundraWrapper.executeHook).toBeCalledWith('after-invocation', expectedAfterInvocationData, true);
Expand All @@ -174,6 +176,7 @@ describe('ThundraWrapper', () => {
it('should extract error from response with success status', () => {
const expectedAfterInvocationData = {
error: null,
originalEvent,
response: {statusCode: 200, body:'{\'message\':\'I have failed\'}'}
};
expect(thundraWrapper.executeHook).toBeCalledWith('after-invocation', expectedAfterInvocationData, true);
Expand Down Expand Up @@ -282,6 +285,7 @@ describe('ThundraWrapper', () => {
pc.timeoutMargin = null;
let afterInvocationData = {
error: new TimeoutError('Lambda is timed out.'),
originalEvent,
response: null,
};

Expand Down

0 comments on commit dc263d7

Please sign in to comment.