Skip to content

Commit 572a289

Browse files
authored
docs(prefer-explicit-assert): remove references to old rule (#78)
1 parent 84fe0e0 commit 572a289

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

docs/rules/prefer-explicit-assert.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ elements in their tests rather than just use `getBy*` queries and expect
1313
it doesn't throw an error so it's easier to understand what's the
1414
expected 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-
2216
Examples of **incorrect** code for this rule:
2317

2418
```js
@@ -41,9 +35,6 @@ expect(getByText('foo')).toBeDefined();
4135
const utils = render(<Component />);
4236
expect(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
4940
expect(queryByText('foo')).toBeInTheDocument();
@@ -74,10 +65,6 @@ This rule accepts a single options argument:
7465
If you prefer to use `getBy*` queries implicitly as an assert-like
7566
method 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

Comments
 (0)