Skip to content

Commit

Permalink
refactor(no-test-callback): rename rule to no-done-callback (#653)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: rename `no-test-callback` to `no-done-callback`
  • Loading branch information
G-Rath authored and SimenB committed Sep 4, 2020
1 parent 5e3ba0e commit e15a8d1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ installations requiring long-term consistency.
| [no-conditional-expect](docs/rules/no-conditional-expect.md) | Prevent calling `expect` conditionally | ![recommended][] | |
| [no-deprecated-functions](docs/rules/no-deprecated-functions.md) | Disallow use of deprecated functions | ![recommended][] | ![fixable][] |
| [no-disabled-tests](docs/rules/no-disabled-tests.md) | Disallow disabled tests | ![recommended][] | |
| [no-done-callback](docs/rules/no-done-callback.md) | Avoid using a callback in asynchronous tests | ![recommended][] | ![suggest][] |
| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks | | |
| [no-export](docs/rules/no-export.md) | Disallow using `exports` in files containing tests | ![recommended][] | |
| [no-focused-tests](docs/rules/no-focused-tests.md) | Disallow focused tests | ![recommended][] | ![fixable][] |
Expand All @@ -151,7 +152,6 @@ installations requiring long-term consistency.
| [no-mocks-import](docs/rules/no-mocks-import.md) | Disallow manually importing from `__mocks__` | ![recommended][] | |
| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | Disallow specific matchers & modifiers | | |
| [no-standalone-expect](docs/rules/no-standalone-expect.md) | Disallow using `expect` outside of `it` or `test` blocks | ![recommended][] | |
| [no-test-callback](docs/rules/no-test-callback.md) | Avoid using a callback in asynchronous tests | ![recommended][] | ![suggest][] |
| [no-test-prefixes](docs/rules/no-test-prefixes.md) | Use `.only` and `.skip` over `f` and `x` | ![recommended][] | ![fixable][] |
| [no-test-return-statement](docs/rules/no-test-return-statement.md) | Disallow explicitly returning from tests | | |
| [prefer-called-with](docs/rules/prefer-called-with.md) | Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Avoid using a callback in asynchronous tests (`no-test-callback`)
# Avoid using a callback in asynchronous tests (`no-done-callback`)

Jest allows you to pass a callback to test definitions, typically called `done`,
that is later invoked to indicate that the asynchronous test is complete.
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/__snapshots__/rules.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Object {
"jest/no-conditional-expect": "error",
"jest/no-deprecated-functions": "error",
"jest/no-disabled-tests": "error",
"jest/no-done-callback": "error",
"jest/no-duplicate-hooks": "error",
"jest/no-expect-resolves": "error",
"jest/no-export": "error",
Expand All @@ -32,7 +33,6 @@ Object {
"jest/no-mocks-import": "error",
"jest/no-restricted-matchers": "error",
"jest/no-standalone-expect": "error",
"jest/no-test-callback": "error",
"jest/no-test-prefixes": "error",
"jest/no-test-return-statement": "error",
"jest/no-truthy-falsy": "error",
Expand Down Expand Up @@ -69,6 +69,7 @@ Object {
"jest/no-conditional-expect": "error",
"jest/no-deprecated-functions": "error",
"jest/no-disabled-tests": "warn",
"jest/no-done-callback": "error",
"jest/no-export": "error",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
Expand All @@ -77,7 +78,6 @@ Object {
"jest/no-jest-import": "error",
"jest/no-mocks-import": "error",
"jest/no-standalone-expect": "error",
"jest/no-test-callback": "error",
"jest/no-test-prefixes": "error",
"jest/no-try-expect": "error",
"jest/valid-describe": "error",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-test-callback';
import rule from '../no-done-callback';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
Expand All @@ -10,7 +10,7 @@ const ruleTester = new TSESLint.RuleTester({
},
});

ruleTester.run('no-test-callback', rule, {
ruleTester.run('no-done-callback', rule, {
valid: [
'test("something", () => {})',
'test("something", async () => {})',
Expand Down
File renamed without changes.

0 comments on commit e15a8d1

Please sign in to comment.