Skip to content

Commit

Permalink
Update toMatchStyleDiffSnapshot docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Mar 23, 2022
1 parent adc2565 commit fe79ab8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions typings/testing-library/index.d.ts
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;
}
}

0 comments on commit fe79ab8

Please sign in to comment.