Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(prefer-implicit-assert): typos in docs #829

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/rules/prefer-implicit-assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<!-- end auto-generated rule header -->

Testing Library `getBy*` & `findBy*` queries throw an error if the element is not
found. Therefore it is not necessary to also assert existance with things like `expect(getBy*.toBeInTheDocument()` or `expect(awaint findBy*).not.toBeNull()`
found. Therefore it is not necessary to also assert existence with things like `expect(getBy*.toBeInTheDocument()` or `expect(await findBy*).not.toBeNull()`

## Rule Details

This rule aims to reuduce uncecessary assertion's for presense of an element,
This rule aims to reduce unnecessary assertion's for presence of an element,
when using queries that implicitly fail when said element is not found.

Examples of **incorrect** code for this rule with the default configuration:
Expand All @@ -26,7 +26,7 @@ expect(utils.getByText('foo')).toBeInTheDocument();
expect(await utils.findByText('foo')).toBeInTheDocument();

expect(await findByText('foo')).not.toBeNull();
expect(await findByText('foo')).not.toBeUndified();
expect(await findByText('foo')).not.toBeUndefined();
```

Examples of **correct** code for this rule with the default configuration:
Expand All @@ -39,7 +39,7 @@ const utils = render(<Component />);
utils.getByText('foo');
await utils.findByText('foo');

// When using queryBy* queries thees do not implicitly fial therefore you should explicitly check if your elements eixst or not
// When using queryBy* queries these do not implicitly fail therefore you should explicitly check if your elements exist or not
expect(queryByText('foo')).toBeInTheDocument();
expect(queryByText('foo')).not.toBeInTheDocument();
```
Expand Down