@@ -134,6 +134,11 @@ ruleTester.run('prefer-to-be: undefined', rule, {
134134 output : 'expect("a string").toBeDefined();' ,
135135 errors : [ { messageId : 'useToBeDefined' , column : 24 , line : 1 } ] ,
136136 } ,
137+ {
138+ code : 'expect("a string").rejects.not.toBe(undefined);' ,
139+ output : 'expect("a string").rejects.toBeDefined();' ,
140+ errors : [ { messageId : 'useToBeDefined' , column : 32 , line : 1 } ] ,
141+ } ,
137142 {
138143 code : 'expect("a string").not.toEqual(undefined);' ,
139144 output : 'expect("a string").toBeDefined();' ,
@@ -181,6 +186,11 @@ ruleTester.run('prefer-to-be: NaN', rule, {
181186 output : 'expect("a string").not.toBeNaN();' ,
182187 errors : [ { messageId : 'useToBeNaN' , column : 24 , line : 1 } ] ,
183188 } ,
189+ {
190+ code : 'expect("a string").rejects.not.toBe(NaN);' ,
191+ output : 'expect("a string").rejects.not.toBeNaN();' ,
192+ errors : [ { messageId : 'useToBeNaN' , column : 32 , line : 1 } ] ,
193+ } ,
184194 {
185195 code : 'expect("a string").not.toEqual(NaN);' ,
186196 output : 'expect("a string").not.toBeNaN();' ,
@@ -218,6 +228,11 @@ ruleTester.run('prefer-to-be: undefined vs defined', rule, {
218228 output : 'expect(undefined).resolves.toBeUndefined();' ,
219229 errors : [ { messageId : 'useToBeUndefined' , column : 32 , line : 1 } ] ,
220230 } ,
231+ {
232+ code : 'expect(undefined).resolves.toBe(undefined);' ,
233+ output : 'expect(undefined).resolves.toBeUndefined();' ,
234+ errors : [ { messageId : 'useToBeUndefined' , column : 28 , line : 1 } ] ,
235+ } ,
221236 {
222237 code : 'expect("a string").not.toBeUndefined();' ,
223238 output : 'expect("a string").toBeDefined();' ,
0 commit comments