eslint-plugin-jest
Advanced tools
Comparing version 23.11.0 to 23.12.0
@@ -0,1 +1,10 @@ | ||
# [23.12.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.11.0...v23.12.0) (2020-05-16) | ||
### Features | ||
* deprecate `no-expect-resolves` rule ([b6a22e5](https://github.com/jest-community/eslint-plugin-jest/commit/b6a22e5aa98abcb57aac217c6d4583d0a3388e7b)) | ||
* deprecate `no-truthy-falsy` rule ([a67d92d](https://github.com/jest-community/eslint-plugin-jest/commit/a67d92d2834568122f24bf3d8455999166da95ea)) | ||
* deprecate `prefer-inline-snapshots` rule ([1360e9b](https://github.com/jest-community/eslint-plugin-jest/commit/1360e9b0e840f4f778a9d251371c943919f84600)) | ||
# [23.11.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.10.0...v23.11.0) (2020-05-12) | ||
@@ -2,0 +11,0 @@ |
@@ -1,2 +0,2 @@ | ||
# Disallow use of deprecated functions (no-deprecated-functions) | ||
# Disallow use of deprecated functions (`no-deprecated-functions`) | ||
@@ -3,0 +3,0 @@ Over the years Jest has accrued some debt in the form of functions that have |
# Avoid using `expect().resolves` (`no-expect-resolves`) | ||
## Deprecated | ||
This rule has been deprecated in favor of | ||
[`no-restricted-matchers`](no-restricted-matchers.md) with the following config: | ||
```json | ||
{ | ||
"rules": { | ||
"jest/no-restricted-matchers": [ | ||
"error", | ||
{ "resolves": "Use `expect(await promise)` instead." } | ||
] | ||
} | ||
} | ||
``` | ||
--- | ||
Jest allows you to test a promise resolve value using `await expect().resolves`. | ||
@@ -4,0 +22,0 @@ For consistency and readability this rule bans `expect().resolves` in favor of |
# Disallow using `toBeTruthy()` & `toBeFalsy()` (`no-truthy-falsy`) | ||
## Deprecated | ||
This rule has been deprecated in favor of | ||
[`no-restricted-matchers`](no-restricted-matchers.md) with the following config: | ||
```json | ||
{ | ||
"rules": { | ||
"jest/no-restricted-matchers": [ | ||
"error", | ||
{ | ||
"toBeTruthy": "Avoid `toBeTruthy`", | ||
"toBeFalsy": "Avoid `toBeFalsy`" | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
--- | ||
Tests against boolean values should assert true or false. Asserting `toBeTruthy` | ||
@@ -4,0 +25,0 @@ or `toBeFalsy` matches non-boolean values as well and encourages weaker tests. |
# Suggest using inline snapshots (`prefer-inline-snapshots`) | ||
## Deprecated | ||
This rule has been deprecated in favor of | ||
[`no-restricted-matchers`](no-restricted-matchers.md) with the following config: | ||
```json | ||
{ | ||
"rules": { | ||
"jest/no-restricted-matchers": [ | ||
"error", | ||
{ | ||
"toThrowErrorMatchingSnapshot": "Use `toThrowErrorMatchingInlineSnapshot()` instead", | ||
"toMatchSnapshot": "Use `toMatchInlineSnapshot()` instead" | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
--- | ||
In order to make snapshot tests more managable and reviewable | ||
@@ -4,0 +25,0 @@ `toMatchInlineSnapshot()` and `toThrowErrorMatchingInlineSnapshot` should be |
@@ -18,2 +18,4 @@ "use strict"; | ||
}, | ||
deprecated: true, | ||
replacedBy: ['no-restricted-matchers'], | ||
messages: { | ||
@@ -20,0 +22,0 @@ expectResolves: 'Use `expect(await promise)` instead.' |
@@ -19,2 +19,4 @@ "use strict"; | ||
}, | ||
deprecated: true, | ||
replacedBy: ['no-restricted-matchers'], | ||
messages: { | ||
@@ -21,0 +23,0 @@ avoidMatcher: 'Avoid {{ matcherName }}' |
@@ -20,2 +20,4 @@ "use strict"; | ||
}, | ||
deprecated: true, | ||
replacedBy: ['no-restricted-matchers'], | ||
messages: { | ||
@@ -22,0 +24,0 @@ toMatch: 'Use toMatchInlineSnapshot() instead', |
{ | ||
"name": "eslint-plugin-jest", | ||
"version": "23.11.0", | ||
"version": "23.12.0", | ||
"description": "Eslint rules for Jest", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -140,3 +140,2 @@ <div align="center"> | ||
| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks | | | | ||
| [no-expect-resolves](docs/rules/no-expect-resolves.md) | Disallow expect.resolves | | | | ||
| [no-export](docs/rules/no-export.md) | Prevent exporting from test files | ![recommended][] | | | ||
@@ -156,3 +155,2 @@ | [no-focused-tests](docs/rules/no-focused-tests.md) | Disallow focused tests | ![recommended][] | ![fixable][] | | ||
| [no-test-return-statement](docs/rules/no-test-return-statement.md) | Disallow explicitly returning from tests | | | | ||
| [no-truthy-falsy](docs/rules/no-truthy-falsy.md) | Disallow using `toBeTruthy()` & `toBeFalsy()` | | | | ||
| [no-try-expect](docs/rules/no-try-expect.md) | Prefer using toThrow for exception tests | ![recommended][] | | | ||
@@ -162,3 +160,2 @@ | [prefer-called-with](docs/rules/prefer-called-with.md) | Suggest using `toBeCalledWith()` OR `toHaveBeenCalledWith()` | | | | ||
| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | Suggest to have all hooks at top level | | | | ||
| [prefer-inline-snapshots](docs/rules/prefer-inline-snapshots.md) | Suggest using inline snapshots | | ![fixable][] | | ||
| [prefer-spy-on](docs/rules/prefer-spy-on.md) | Suggest using `jest.spyOn()` | | ![fixable][] | | ||
@@ -165,0 +162,0 @@ | [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | Suggest using toStrictEqual() | | ![fixable][] | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
212159
3610
191