-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate Jest matchers to @jest/globals types (#198)
Jest now includes own types in @jest/globals packages. Use it for custom Jest matchers types. Add declaration exposing custom matchers in the "expect" library types. Fixes #180
- Loading branch information
1 parent
d6b6b4d
commit 8f14cbb
Showing
5 changed files
with
358 additions
and
92 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
14 changes: 14 additions & 0 deletions
14
packages/aws-sdk-client-mock-jest/test/jestGlobals.test.ts
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,14 @@ | ||
import {mockClient} from 'aws-sdk-client-mock'; | ||
import {PublishCommand, SNSClient} from '@aws-sdk/client-sns'; | ||
import {publishCmd1} from 'aws-sdk-client-mock/test/fixtures'; | ||
import {expect, it} from '@jest/globals'; | ||
import '../src'; | ||
|
||
const snsMock = mockClient(SNSClient); | ||
|
||
it('passes using @jest/globals', async () => { | ||
const sns = new SNSClient({}); | ||
await sns.send(publishCmd1); | ||
|
||
expect(() => expect(snsMock).toHaveReceivedCommand(PublishCommand)).not.toThrow(); | ||
}); |
Oops, something went wrong.