@@ -40,6 +40,18 @@ const generateInvalidCases = (
4040 } ,
4141 ] ,
4242 } ,
43+ {
44+ code : `expect(value ${ operator } 1).resolves.${ equalityMatcher } (true);` ,
45+ output : `expect(value).resolves.${ preferredMatcher } (1);` ,
46+ errors : [
47+ {
48+ messageId : 'useToBeComparison' ,
49+ data : { preferredMatcher } ,
50+ column : 27 + operator . length ,
51+ line : 1 ,
52+ } ,
53+ ] ,
54+ } ,
4355 {
4456 code : `expect(value ${ operator } 1).${ equalityMatcher } (false);` ,
4557 output : `expect(value).${ preferredMatcherWhenNegated } (1);` ,
@@ -64,6 +76,18 @@ const generateInvalidCases = (
6476 } ,
6577 ] ,
6678 } ,
79+ {
80+ code : `expect(value ${ operator } 1).resolves.${ equalityMatcher } (false);` ,
81+ output : `expect(value).resolves.${ preferredMatcherWhenNegated } (1);` ,
82+ errors : [
83+ {
84+ messageId : 'useToBeComparison' ,
85+ data : { preferredMatcher : preferredMatcherWhenNegated } ,
86+ column : 27 + operator . length ,
87+ line : 1 ,
88+ } ,
89+ ] ,
90+ } ,
6791 {
6892 code : `expect(value ${ operator } 1).not.${ equalityMatcher } (true);` ,
6993 output : `expect(value).${ preferredMatcherWhenNegated } (1);` ,
@@ -88,6 +112,18 @@ const generateInvalidCases = (
88112 } ,
89113 ] ,
90114 } ,
115+ {
116+ code : `expect(value ${ operator } 1).resolves.not.${ equalityMatcher } (true);` ,
117+ output : `expect(value).resolves.${ preferredMatcherWhenNegated } (1);` ,
118+ errors : [
119+ {
120+ messageId : 'useToBeComparison' ,
121+ data : { preferredMatcher : preferredMatcherWhenNegated } ,
122+ column : 27 + operator . length ,
123+ line : 1 ,
124+ } ,
125+ ] ,
126+ } ,
91127 {
92128 code : `expect(value ${ operator } 1).not.${ equalityMatcher } (false);` ,
93129 output : `expect(value).${ preferredMatcher } (1);` ,
@@ -100,6 +136,54 @@ const generateInvalidCases = (
100136 } ,
101137 ] ,
102138 } ,
139+ {
140+ code : `expect(value ${ operator } 1).resolves.not.${ equalityMatcher } (false);` ,
141+ output : `expect(value).resolves.${ preferredMatcher } (1);` ,
142+ errors : [
143+ {
144+ messageId : 'useToBeComparison' ,
145+ data : { preferredMatcher } ,
146+ column : 27 + operator . length ,
147+ line : 1 ,
148+ } ,
149+ ] ,
150+ } ,
151+ {
152+ code : `expect(value ${ operator } 1)["resolves"].not.${ equalityMatcher } (false);` ,
153+ output : `expect(value).resolves.${ preferredMatcher } (1);` ,
154+ errors : [
155+ {
156+ messageId : 'useToBeComparison' ,
157+ data : { preferredMatcher } ,
158+ column : 30 + operator . length ,
159+ line : 1 ,
160+ } ,
161+ ] ,
162+ } ,
163+ {
164+ code : `expect(value ${ operator } 1)["resolves"]["not"].${ equalityMatcher } (false);` ,
165+ output : `expect(value).resolves.${ preferredMatcher } (1);` ,
166+ errors : [
167+ {
168+ messageId : 'useToBeComparison' ,
169+ data : { preferredMatcher } ,
170+ column : 30 + operator . length ,
171+ line : 1 ,
172+ } ,
173+ ] ,
174+ } ,
175+ {
176+ code : `expect(value ${ operator } 1)["resolves"]["not"]['${ equalityMatcher } '](false);` ,
177+ output : `expect(value).resolves.${ preferredMatcher } (1);` ,
178+ errors : [
179+ {
180+ messageId : 'useToBeComparison' ,
181+ data : { preferredMatcher } ,
182+ column : 30 + operator . length ,
183+ line : 1 ,
184+ } ,
185+ ] ,
186+ } ,
103187 ] ;
104188} ;
105189
@@ -128,6 +212,8 @@ const generateValidStringLiteralCases = (operator: string, matcher: string) => {
128212 `expect(${ b } ${ operator } ${ a } ).not.${ matcher } (true)` ,
129213 `expect(${ b } ${ operator } ${ a } ).not.${ matcher } (false)` ,
130214 `expect(${ b } ${ operator } ${ b } ).not.${ matcher } (false)` ,
215+ `expect(${ b } ${ operator } ${ b } ).resolves.not.${ matcher } (false)` ,
216+ `expect(${ b } ${ operator } ${ b } ).resolves.${ matcher } (false)` ,
131217 ] ,
132218 ] ) ;
133219} ;
0 commit comments