Skip to content

Commit a7d7c5e

Browse files
authored
docs: minor tweaks (#911)
* docs(max-nested-describe): fix syntax error * docs(no-done-callback): minor grammar tweaks * docs(no-standalone-expect): minor grammar tweak * docs(no-test-return-statement): minor grammar tweak
1 parent 498294d commit a7d7c5e

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

docs/rules/max-nested-describe.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,15 @@ describe('foo', () => {
116116
});
117117
});
118118

119-
describe('foo2', function()) {
120-
describe('bar2', function() {
121-
it('should get something', function() {
119+
describe('foo2', function () {
120+
describe('bar2', function () {
121+
it('should get something', function () {
122122
expect(getSomething()).toBe('Something');
123123
});
124124

125-
it('should get else', function() {
125+
it('should get else', function () {
126126
expect(getSomething()).toBe('Something');
127127
});
128128
});
129129
});
130-
131130
```

docs/rules/no-done-callback.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ test('the data is peanut butter', done => {
2020
});
2121
```
2222

23-
This can be very error prone however, as it requires careful understanding of
23+
This can be very error-prone however, as it requires careful understanding of
2424
how assertions work in tests or otherwise tests won't behave as expected.
2525

2626
For example, if the `try/catch` was left out of the above code, the test would
27-
timeout rather than fail. Even with the `try/catch`, forgetting to pass the
27+
time out rather than fail. Even with the `try/catch`, forgetting to pass the
2828
caught error to `done` will result in `jest` believing the test has passed.
2929

3030
A more straightforward way to handle asynchronous code is to use Promises:

docs/rules/no-standalone-expect.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ trigger this rule.
88

99
This rule aims to eliminate `expect` statements that will not be executed. An
1010
`expect` inside of a `describe` block but outside of a `test` or `it` block or
11-
outside of a `describe` will not execute and therefore will trigger this rule.
12-
It is viable, however, to have an `expect` in a helper function that is called
13-
from within a `test` or `it` block so `expect` statements in a function will not
11+
outside a `describe` will not execute and therefore will trigger this rule. It
12+
is viable, however, to have an `expect` in a helper function that is called from
13+
within a `test` or `it` block so `expect` statements in a function will not
1414
trigger this rule.
1515

1616
Statements like `expect.hasAssertions()` will NOT trigger this rule since these

docs/rules/no-test-return-statement.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ If you are returning Promises then you should update the test to use
77

88
## Rule details
99

10-
This rule triggers a warning if you use a return statement inside of a test
11-
body.
10+
This rule triggers a warning if you use a return statement inside a test body.
1211

1312
```js
1413
/*eslint jest/no-test-return-statement: "error"*/

0 commit comments

Comments
 (0)