mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[@types/jest] Improve toContain matcher description. (#42965)
This commit is contained in:
parent
3c7535ff99
commit
86d96fc87e
2
types/jest/index.d.ts
vendored
2
types/jest/index.d.ts
vendored
@ -26,6 +26,7 @@
|
||||
// Tony Hallett <https://github.com/tonyhallett>
|
||||
// Jason Yu <https://github.com/ycmjason>
|
||||
// Devansh Jethmalani <https://github.com/devanshj>
|
||||
// Pawel Fajfer <https://github.com/pawfa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
@ -805,6 +806,7 @@ declare namespace jest {
|
||||
/**
|
||||
* Used when you want to check that an item is in a list.
|
||||
* For testing the items in the list, this uses `===`, a strict equality check.
|
||||
* It can also check whether a string is a substring of another string.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
|
||||
@ -869,6 +869,7 @@ describe('', () => {
|
||||
expect([]).toContain({});
|
||||
expect(['abc']).toContain('abc');
|
||||
expect(['abc']).toContain('def');
|
||||
expect('abc').toContain('bc');
|
||||
|
||||
expect([]).toContainEqual({});
|
||||
expect(['abc']).toContainEqual('def');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user