Skip to content

Commit

Permalink
feat(prefer-presence-queries): support react-native matcher `toBeOnTh…
Browse files Browse the repository at this point in the history
…eScreen` (#844)

Update `testing-library/prefer-presence-queries` rule to support custom react-native matcher `toBeOnTheScreen`s

Signed-off-by: Davyd NRB <4661784+retyui@users.noreply.github.com>
  • Loading branch information
retyui committed Nov 21, 2023
1 parent 9709343 commit b9fef59
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/utils/index.ts
Expand Up @@ -110,7 +110,12 @@ const ALL_RETURNING_NODES = [
...METHODS_RETURNING_NODES,
];

const PRESENCE_MATCHERS = ['toBeInTheDocument', 'toBeTruthy', 'toBeDefined'];
const PRESENCE_MATCHERS = [
'toBeOnTheScreen',
'toBeInTheDocument',
'toBeTruthy',
'toBeDefined',
];
const ABSENCE_MATCHERS = ['toBeNull', 'toBeFalsy'];

export {
Expand Down

0 comments on commit b9fef59

Please sign in to comment.