Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/rules/max-nested-describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,15 @@ describe('foo', () => {
});
});

describe('foo2', function()) {
describe('bar2', function() {
it('should get something', function() {
describe('foo2', function () {
describe('bar2', function () {
it('should get something', function () {
expect(getSomething()).toBe('Something');
});

it('should get else', function() {
it('should get else', function () {
expect(getSomething()).toBe('Something');
});
});
});

```
4 changes: 2 additions & 2 deletions docs/rules/no-done-callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ test('the data is peanut butter', done => {
});
```

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

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

A more straightforward way to handle asynchronous code is to use Promises:
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/no-standalone-expect.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ trigger this rule.

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

Statements like `expect.hasAssertions()` will NOT trigger this rule since these
Expand Down
3 changes: 1 addition & 2 deletions docs/rules/no-test-return-statement.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ If you are returning Promises then you should update the test to use

## Rule details

This rule triggers a warning if you use a return statement inside of a test
body.
This rule triggers a warning if you use a return statement inside a test body.

```js
/*eslint jest/no-test-return-statement: "error"*/
Expand Down