@@ -37,6 +37,26 @@ ruleTester.run('no-restricted-matchers', rule, {
37
37
code : 'expect(a)["toBe"](b)' ,
38
38
options : [ { 'not.toBe' : null } ] ,
39
39
} ,
40
+ {
41
+ code : 'expect(a).resolves.not.toBe(b)' ,
42
+ options : [ { not : null } ] ,
43
+ } ,
44
+ {
45
+ code : 'expect(a).resolves.not.toBe(b)' ,
46
+ options : [ { 'not.toBe' : null } ] ,
47
+ } ,
48
+ {
49
+ code : "expect(uploadFileMock).resolves.toHaveBeenCalledWith('file.name')" ,
50
+ options : [
51
+ { 'not.toHaveBeenCalledWith' : 'Use not.toHaveBeenCalled instead' } ,
52
+ ] ,
53
+ } ,
54
+ {
55
+ code : "expect(uploadFileMock).resolves.not.toHaveBeenCalledWith('file.name')" ,
56
+ options : [
57
+ { 'not.toHaveBeenCalledWith' : 'Use not.toHaveBeenCalled instead' } ,
58
+ ] ,
59
+ } ,
40
60
] ,
41
61
invalid : [
42
62
{
@@ -47,7 +67,7 @@ ruleTester.run('no-restricted-matchers', rule, {
47
67
messageId : 'restrictedChain' ,
48
68
data : {
49
69
message : null ,
50
- chain : 'toBe' ,
70
+ restriction : 'toBe' ,
51
71
} ,
52
72
column : 11 ,
53
73
line : 1 ,
@@ -62,7 +82,7 @@ ruleTester.run('no-restricted-matchers', rule, {
62
82
messageId : 'restrictedChain' ,
63
83
data : {
64
84
message : null ,
65
- chain : 'toBe' ,
85
+ restriction : 'toBe' ,
66
86
} ,
67
87
column : 11 ,
68
88
line : 1 ,
@@ -77,7 +97,7 @@ ruleTester.run('no-restricted-matchers', rule, {
77
97
messageId : 'restrictedChain' ,
78
98
data : {
79
99
message : null ,
80
- chain : 'not' ,
100
+ restriction : 'not' ,
81
101
} ,
82
102
column : 11 ,
83
103
line : 1 ,
@@ -92,7 +112,7 @@ ruleTester.run('no-restricted-matchers', rule, {
92
112
messageId : 'restrictedChain' ,
93
113
data : {
94
114
message : null ,
95
- chain : 'not' ,
115
+ restriction : 'not' ,
96
116
} ,
97
117
column : 11 ,
98
118
line : 1 ,
@@ -107,28 +127,13 @@ ruleTester.run('no-restricted-matchers', rule, {
107
127
messageId : 'restrictedChain' ,
108
128
data : {
109
129
message : null ,
110
- chain : 'resolves' ,
130
+ restriction : 'resolves' ,
111
131
} ,
112
132
column : 11 ,
113
133
line : 1 ,
114
134
} ,
115
135
] ,
116
136
} ,
117
- {
118
- code : 'expect(a).resolves.not.toBe(b)' ,
119
- options : [ { not : null } ] ,
120
- errors : [
121
- {
122
- messageId : 'restrictedChain' ,
123
- data : {
124
- message : null ,
125
- chain : 'not' ,
126
- } ,
127
- column : 20 ,
128
- line : 1 ,
129
- } ,
130
- ] ,
131
- } ,
132
137
{
133
138
code : 'expect(a).resolves.not.toBe(b)' ,
134
139
options : [ { resolves : null } ] ,
@@ -137,7 +142,7 @@ ruleTester.run('no-restricted-matchers', rule, {
137
142
messageId : 'restrictedChain' ,
138
143
data : {
139
144
message : null ,
140
- chain : 'resolves' ,
145
+ restriction : 'resolves' ,
141
146
} ,
142
147
column : 11 ,
143
148
line : 1 ,
@@ -152,29 +157,13 @@ ruleTester.run('no-restricted-matchers', rule, {
152
157
messageId : 'restrictedChain' ,
153
158
data : {
154
159
message : null ,
155
- chain : 'resolves.not' ,
160
+ restriction : 'resolves.not' ,
156
161
} ,
157
162
column : 11 ,
158
163
line : 1 ,
159
164
} ,
160
165
] ,
161
166
} ,
162
- {
163
- code : 'expect(a).resolves.not.toBe(b)' ,
164
- options : [ { 'not.toBe' : null } ] ,
165
- errors : [
166
- {
167
- messageId : 'restrictedChain' ,
168
- data : {
169
- message : null ,
170
- chain : 'not.toBe' ,
171
- } ,
172
- endColumn : 28 ,
173
- column : 20 ,
174
- line : 1 ,
175
- } ,
176
- ] ,
177
- } ,
178
167
{
179
168
code : 'expect(a).not.toBe(b)' ,
180
169
options : [ { 'not.toBe' : null } ] ,
@@ -183,7 +172,7 @@ ruleTester.run('no-restricted-matchers', rule, {
183
172
messageId : 'restrictedChain' ,
184
173
data : {
185
174
message : null ,
186
- chain : 'not.toBe' ,
175
+ restriction : 'not.toBe' ,
187
176
} ,
188
177
endColumn : 19 ,
189
178
column : 11 ,
@@ -199,7 +188,7 @@ ruleTester.run('no-restricted-matchers', rule, {
199
188
messageId : 'restrictedChain' ,
200
189
data : {
201
190
message : null ,
202
- chain : 'resolves.not.toBe' ,
191
+ restriction : 'resolves.not.toBe' ,
203
192
} ,
204
193
endColumn : 28 ,
205
194
column : 11 ,
@@ -215,7 +204,7 @@ ruleTester.run('no-restricted-matchers', rule, {
215
204
messageId : 'restrictedChainWithMessage' ,
216
205
data : {
217
206
message : 'Prefer `toStrictEqual` instead' ,
218
- chain : 'toBe' ,
207
+ restriction : 'toBe' ,
219
208
} ,
220
209
column : 11 ,
221
210
line : 1 ,
@@ -234,25 +223,25 @@ ruleTester.run('no-restricted-matchers', rule, {
234
223
messageId : 'restrictedChainWithMessage' ,
235
224
data : {
236
225
message : 'Use `expect(await promise)` instead.' ,
237
- chain : 'resolves' ,
226
+ restriction : 'resolves' ,
238
227
} ,
239
- endColumn : 52 ,
228
+ endColumn : 57 ,
240
229
column : 44 ,
241
230
} ,
242
231
] ,
243
232
} ,
244
233
{
245
234
code : 'expect(Promise.resolve({})).rejects.toBeFalsy()' ,
246
- options : [ { toBeFalsy : null } ] ,
235
+ options : [ { 'rejects. toBeFalsy' : null } ] ,
247
236
errors : [
248
237
{
249
238
messageId : 'restrictedChain' ,
250
239
data : {
251
240
message : null ,
252
- chain : 'toBeFalsy' ,
241
+ restriction : 'rejects. toBeFalsy' ,
253
242
} ,
254
243
endColumn : 46 ,
255
- column : 37 ,
244
+ column : 29 ,
256
245
} ,
257
246
] ,
258
247
} ,
@@ -266,7 +255,7 @@ ruleTester.run('no-restricted-matchers', rule, {
266
255
messageId : 'restrictedChainWithMessage' ,
267
256
data : {
268
257
message : 'Use not.toHaveBeenCalled instead' ,
269
- chain : 'not.toHaveBeenCalledWith' ,
258
+ restriction : 'not.toHaveBeenCalledWith' ,
270
259
} ,
271
260
endColumn : 48 ,
272
261
column : 24 ,
0 commit comments