Skip to content

Commit 9209b14

Browse files
committed
docs: automate docs with eslint-doc-generator
1 parent 48b969e commit 9209b14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+328
-775
lines changed

README.md

Lines changed: 79 additions & 80 deletions
Large diffs are not rendered by default.

docs/rules/consistent-test-it.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# Have control over `test` and `it` usages (`consistent-test-it`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`.
3+
🔧 This rule is automatically fixable by the
4+
[`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
65

7-
🔧 This rule is automatically fixable using the `--fix`
8-
[option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix)
9-
on the command line.
10-
11-
<!-- end rule header -->
6+
<!-- end auto-generated rule header -->
127

138
Jest allows you to choose how you want to define your tests, using the `it` or
149
the `test` keywords, with multiple permutations for each:
@@ -81,8 +76,6 @@ describe('foo', function () {
8176
});
8277
```
8378

84-
### Default configuration
85-
8679
The default configuration forces all top-level tests to use `test` and all tests
8780
nested within `describe` to use `it`.
8881

docs/rules/expect-expect.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Enforce assertion to be made in a test body (`expect-expect`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`.
3+
✅ This rule will _warn_ in the `recommended`
4+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
65

7-
<!-- end rule header -->
6+
<!-- end auto-generated rule header -->
87

98
Ensure that there is at least one `expect` call made in a test.
109

docs/rules/max-expects.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Enforces a maximum number assertion calls in a test body (`max-expects`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`.
6-
7-
<!-- end rule header -->
3+
<!-- end auto-generated rule header -->
84

95
As more assertions are made, there is a possible tendency for the test to be
106
more likely to mix multiple objectives. To avoid this, this rule reports when

docs/rules/max-nested-describe.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Enforces a maximum depth to nested describe calls (`max-nested-describe`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`.
6-
7-
<!-- end rule header -->
3+
<!-- end auto-generated rule header -->
84

95
While it's useful to be able to group your tests together within the same file
106
using `describe()`, having too many levels of nesting throughout your tests make

docs/rules/no-alias-methods.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Disallow alias methods (`no-alias-methods`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`, `recommended`.
3+
💼 This rule is enabled in the `recommended`
4+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
5+
This rule will _warn_ in the `style`
6+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
67

7-
🔧 This rule is automatically fixable using the `--fix`
8-
[option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix)
9-
on the command line.
8+
🔧 This rule is automatically fixable by the
9+
[`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
1010

11-
<!-- end rule header -->
11+
<!-- end auto-generated rule header -->
1212

1313
> These aliases are going to be removed in the next major version of Jest - see
14-
> https://github.com/facebook/jest/issues/13164 for more
14+
> <https://github.com/facebook/jest/issues/13164> for more
1515
1616
Several Jest methods have alias names, such as `toThrow` having the alias of
1717
`toThrowError`. This rule ensures that only the canonical name as used in the
@@ -24,8 +24,6 @@ method names used.
2424
This rule triggers a warning if the alias name, rather than the canonical name,
2525
of a method is used.
2626

27-
### Default configuration
28-
2927
The following patterns are considered warnings:
3028

3129
```js

docs/rules/no-commented-out-tests.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Disallow commented out tests (`no-commented-out-tests`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`.
3+
✅ This rule will _warn_ in the `recommended`
4+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
65

7-
<!-- end rule header -->
6+
<!-- end auto-generated rule header -->
87

98
This rule raises a warning about commented out tests. It's similar to
109
no-disabled-tests rule.

docs/rules/no-conditional-expect.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Prevent calling `expect` conditionally (`no-conditional-expect`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`, `recommended`.
3+
✅ This rule is enabled in the `recommended`
4+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
65

7-
<!-- end rule header -->
6+
<!-- end auto-generated rule header -->
87

98
This rule prevents the use of `expect` in conditional blocks, such as `if`s &
109
`catch`s.

docs/rules/no-conditional-in-test.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Disallow conditional logic in tests (`no-conditional-in-test`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`.
6-
7-
<!-- end rule header -->
3+
<!-- end auto-generated rule header -->
84

95
Conditional logic in tests is usually an indication that a test is attempting to
106
cover too much, and not testing the logic it intends to. Each branch of code

docs/rules/no-deprecated-functions.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Disallow use of deprecated functions (`no-deprecated-functions`)
22

3-
💼 This rule is enabled in the following
4-
[configs](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations):
5-
`all`, `recommended`.
3+
✅ This rule is enabled in the `recommended`
4+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
65

7-
🔧 This rule is automatically fixable using the `--fix`
8-
[option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix)
9-
on the command line.
6+
🔧 This rule is automatically fixable by the
7+
[`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
108

11-
<!-- end rule header -->
9+
<!-- end auto-generated rule header -->
1210

1311
Over the years Jest has accrued some debt in the form of functions that have
1412
either been renamed for clarity, or replaced with more powerful APIs.

0 commit comments

Comments
 (0)