-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update toMatchStyleDiffSnapshot docs
- Loading branch information
Showing
1 changed file
with
8 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
/// <reference types="jest"/> | ||
|
||
declare namespace jest { | ||
interface Matchers< R, T > { | ||
interface Matchers< R > { | ||
/** | ||
* Similar to `toMatchDiffSnapshot`, but only taking into account the style | ||
* rules associated to the two elements being compared. | ||
* Similar to the [`toMatchDiffSnapshot` matcher](https://github.com/jest-community/snapshot-diff), this custom matcher allows to snapshot only the difference | ||
* between the _styles_ associated to two different states of a component. | ||
* | ||
* @see [test/unit/config/matchers/to-match-style-diff-snapshot.js](https://github.com/WordPress/gutenberg/blob/trunk/test/unit/config/matchers/to-match-style-diff-snapshot.js) | ||
* @see [Testing Overview docs](https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/code/testing-overview.md#best-practices) | ||
* @cite https://github.com/testing-library/react-testing-library/issues/36#issuecomment-440442300 | ||
*/ | ||
toMatchStyleDiffSnapshot( expected: Element ): R; | ||
toMatchStyleDiffSnapshot( expected: Element | null ): R; | ||
} | ||
} |