-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add a test suite with 100% [brag] code coverage to AWSLambda ha…
…ndler (#2891) * test: Add a test suite with 100% [brag] code coverage to AWSLambda handler
- Loading branch information
1 parent
263c880
commit daae471
Showing
7 changed files
with
437 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export const SDK_VERSION = '6.6.6'; | ||
export const Severity = { | ||
Warning: 'warning', | ||
}; | ||
export const fakeScope = { | ||
addEventProcessor: jest.fn(), | ||
setTransactionName: jest.fn(), | ||
setTag: jest.fn(), | ||
setContext: jest.fn(), | ||
}; | ||
export const captureException = jest.fn(); | ||
export const captureMessage = jest.fn(); | ||
export const withScope = jest.fn(cb => cb(fakeScope)); | ||
export const flush = jest.fn(() => Promise.resolve()); | ||
|
||
export const resetMocks = (): void => { | ||
fakeScope.addEventProcessor.mockClear(); | ||
fakeScope.setTransactionName.mockClear(); | ||
fakeScope.setTag.mockClear(); | ||
fakeScope.setContext.mockClear(); | ||
|
||
captureException.mockClear(); | ||
captureMessage.mockClear(); | ||
withScope.mockClear(); | ||
flush.mockClear(); | ||
}; |
Oops, something went wrong.