Skip to content

Commit a09b361

Browse files
authored
docs: automate docs with eslint-doc-generator (#690)
1 parent dbb5889 commit a09b361

31 files changed

+169
-172
lines changed

README.md

Lines changed: 41 additions & 42 deletions
Large diffs are not rendered by default.

docs/rules/await-async-query.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Enforce promises from async queries to be handled (`testing-library/await-async-query`)
22

3+
💼 This rule is enabled in the following configs: `angular`, `dom`, `marko`, `react`, `vue`.
4+
5+
<!-- end auto-generated rule header -->
6+
37
Ensure that promises returned by async queries are handled properly.
48

59
## Rule Details

docs/rules/await-async-utils.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Enforce promises from async utils to be handled (`testing-library/await-async-utils`)
1+
# Enforce promises from async utils to be awaited properly (`testing-library/await-async-utils`)
2+
3+
💼 This rule is enabled in the following configs: `angular`, `dom`, `marko`, `react`, `vue`.
4+
5+
<!-- end auto-generated rule header -->
26

37
Ensure that promises returned by async utils are handled properly.
48

docs/rules/await-fire-event.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Enforce promises from fire event methods to be handled (`testing-library/await-fire-event`)
1+
# Enforce promises from `fireEvent` methods to be handled (`testing-library/await-fire-event`)
2+
3+
💼 This rule is enabled in the following configs: `marko`, `vue`.
4+
5+
<!-- end auto-generated rule header -->
26

37
Ensure that promises returned by `fireEvent` methods are handled
48
properly.

docs/rules/consistent-data-testid.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Enforces consistent naming for the data-testid attribute (`testing-library/consistent-data-testid`)
1+
# Ensures consistent usage of `data-testid` (`testing-library/consistent-data-testid`)
2+
3+
<!-- end auto-generated rule header -->
24

35
Ensure `data-testid` values match a provided regex. This rule is un-opinionated, and requires configuration.
46

docs/rules/no-await-sync-events.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow unnecessary `await` for sync events (`testing-library/no-await-sync-events`)
22

3+
<!-- end auto-generated rule header -->
4+
35
Ensure that sync simulated events are not awaited unnecessarily.
46

57
## Rule Details

docs/rules/no-await-sync-query.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Disallow unnecessary `await` for sync queries (`testing-library/no-await-sync-query`)
22

3+
💼 This rule is enabled in the following configs: `angular`, `dom`, `marko`, `react`, `vue`.
4+
5+
<!-- end auto-generated rule header -->
6+
37
Ensure that sync queries are not awaited unnecessarily.
48

59
## Rule Details

docs/rules/no-container.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Disallow the use of `container` methods (`testing-library/no-container`)
22

3+
💼 This rule is enabled in the following configs: `angular`, `marko`, `react`, `vue`.
4+
5+
<!-- end auto-generated rule header -->
6+
37
By using `container` methods like `.querySelector` you may lose a lot of the confidence that the user can really interact with your UI. Also, the test becomes harder to read, and it will break more frequently.
48

59
This applies to Testing Library frameworks built on top of **DOM Testing Library**

docs/rules/no-debugging-utils.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Disallow the use of debugging utilities (`testing-library/no-debugging-utils`)
1+
# Disallow the use of debugging utilities like `debug` (`testing-library/no-debugging-utils`)
2+
3+
💼 This rule is enabled in the following configs: `angular`, `marko`, `react`, `vue`.
4+
5+
<!-- end auto-generated rule header -->
26

37
Just like `console.log` statements pollutes the browser's output, debug statements also pollutes the tests if one of your teammates forgot to remove it. `debug` statements should be used when you actually want to debug your tests but should not be pushed to the codebase.
48

@@ -37,6 +41,8 @@ const { screen } = require('@testing-library/react');
3741
screen.debug();
3842
```
3943

44+
## Options
45+
4046
You can control which debugging utils are checked for with the `utilsToCheckFor` option:
4147

4248
```json

docs/rules/no-dom-import.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Disallow importing from DOM Testing Library (`testing-library/no-dom-import`)
22

3+
💼 This rule is enabled in the following configs: `angular`, `marko`, `react`, `vue`.
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
8+
39
Ensure that there are no direct imports from `@testing-library/dom` or
410
`dom-testing-library` when using some testing library framework
511
wrapper.

0 commit comments

Comments
 (0)