@@ -13,12 +13,6 @@ elements in their tests rather than just use `getBy*` queries and expect
1313it doesn't throw an error so it's easier to understand what's the
1414expected behavior within the test.
1515
16- > ⚠️ Please note that this rule is recommended to be used together with
17- > [ prefer-expect-query-by] ( docs/rules/prefer-expect-query-by.md ) , so the
18- > combination of these two rules will force users to do 2 actual
19- > changes: wrap ` getBy* ` with ` expect ` assertion and then use ` queryBy* `
20- > instead of ` getBy* ` for asserting.
21-
2216Examples of ** incorrect** code for this rule:
2317
2418``` js
@@ -41,9 +35,6 @@ expect(getByText('foo')).toBeDefined();
4135const utils = render (< Component / > );
4236expect (utils .getByText (' foo' )).toBeDefined ();
4337
44- // ⚠️ `getBy*` should be replaced by `queryBy*` when combined with `prefer-expect-query-by` rule
45- expect (queryByText (' foo' )).toBeDefined ();
46-
4738// even more explicit if you use `@testing-library/jest-dom` matcher
4839// for checking the element is present in the document
4940expect (queryByText (' foo' )).toBeInTheDocument ();
@@ -74,10 +65,6 @@ This rule accepts a single options argument:
7465If you prefer to use ` getBy* ` queries implicitly as an assert-like
7566method itself, then this rule is not recommended.
7667
77- ## Related Rules
78-
79- - [ prefer-expect-query-by] ( prefer-expect-query-by.md )
80-
8168## Further Reading
8269
8370- [ getBy query] ( https://testing-library.com/docs/dom-testing-library/api-queries#getby )
0 commit comments