Commit 1360e9b 1 parent a67d92d commit 1360e9b Copy full SHA for 1360e9b
File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,6 @@ installations requiring long-term consistency.
155
155
| [ prefer-called-with] ( docs/rules/prefer-called-with.md ) | Suggest using ` toBeCalledWith() ` OR ` toHaveBeenCalledWith() ` | | |
156
156
| [ prefer-expect-assertions] ( docs/rules/prefer-expect-assertions.md ) | Suggest using ` expect.assertions() ` OR ` expect.hasAssertions() ` | | |
157
157
| [ prefer-hooks-on-top] ( docs/rules/prefer-hooks-on-top.md ) | Suggest to have all hooks at top level | | |
158
- | [ prefer-inline-snapshots] ( docs/rules/prefer-inline-snapshots.md ) | Suggest using inline snapshots | | ![ fixable] [ ] |
159
158
| [ prefer-spy-on] ( docs/rules/prefer-spy-on.md ) | Suggest using ` jest.spyOn() ` | | ![ fixable] [ ] |
160
159
| [ prefer-strict-equal] ( docs/rules/prefer-strict-equal.md ) | Suggest using toStrictEqual() | | ![ fixable] [ ] |
161
160
| [ prefer-to-be-null] ( docs/rules/prefer-to-be-null.md ) | Suggest using ` toBeNull() ` | ![ style] [ ] | ![ fixable] [ ] |
Original file line number Diff line number Diff line change 1
1
# Suggest using inline snapshots (` prefer-inline-snapshots ` )
2
2
3
+ ## Deprecated
4
+
5
+ This rule has been deprecated in favor of
6
+ [ ` no-restricted-matchers ` ] ( no-restricted-matchers.md ) with the following config:
7
+
8
+ ``` json
9
+ {
10
+ "rules" : {
11
+ "jest/no-restricted-matchers" : [
12
+ " error" ,
13
+ {
14
+ "toThrowErrorMatchingSnapshot" : " Use `toThrowErrorMatchingInlineSnapshot()` instead" ,
15
+ "toMatchSnapshot" : " Use `toMatchInlineSnapshot()` instead"
16
+ }
17
+ ]
18
+ }
19
+ }
20
+ ```
21
+
22
+ ---
23
+
3
24
In order to make snapshot tests more managable and reviewable
4
25
` toMatchInlineSnapshot() ` and ` toThrowErrorMatchingInlineSnapshot ` should be
5
26
used to write the snapshots inline in the test file.
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ export default createRule({
9
9
description : 'Suggest using inline snapshots' ,
10
10
recommended : false ,
11
11
} ,
12
+ deprecated : true ,
13
+ replacedBy : [ 'no-restricted-matchers' ] ,
12
14
messages : {
13
15
toMatch : 'Use toMatchInlineSnapshot() instead' ,
14
16
toMatchError : 'Use toThrowErrorMatchingInlineSnapshot() instead' ,
You can’t perform that action at this time.
0 commit comments