You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(prefer-explicit-assert): add an option to toggle the matching of findBy queries (#452)
A recent patch implemented matching findBy* queries by the
prefer-explicit-assert rule. This patch makes it possible to disable it
in cases where it's too distracting.
Fixes#449
|`assertion`| No | None | This string allows defining the preferred assertion to use with `getBy*` queries. By default, any assertion is valid (`toBeTruthy`, `toBeDefined`, etc.). However, they all assert slightly different things. This option ensures all `getBy*` assertions are consistent and use the same assertion. This rule only allows defining a presence matcher (`toBeInTheDocument`, `toBeTruthy`, or `toBeDefined`), but checks for both presence and absence matchers (`not.toBeFalsy` and `not.toBeNull`). This means other assertions such as `toHaveValue` or `toBeDisabled` will not trigger this rule since these are valid uses with `getBy*`. |`"toBeInTheDocument"`|
60
+
|`includeFindQueries`| No |`true`| This boolean controls whether queries such as `findByText` are also checked by this rule. |`false`|
61
+
62
+
This is how you can use these options in eslint configuration:
0 commit comments