@@ -31,7 +31,7 @@ ruleTester.run('prefer-spy-on', rule, {
3131 type : AST_NODE_TYPES . AssignmentExpression ,
3232 } ,
3333 ] ,
34- output : "jest.spyOn(obj, 'a'); const test = 10;" ,
34+ output : "jest.spyOn(obj, 'a').mockImplementation() ; const test = 10;" ,
3535 } ,
3636 {
3737 code : "Date['now'] = jest['fn']()" ,
@@ -41,7 +41,7 @@ ruleTester.run('prefer-spy-on', rule, {
4141 type : AST_NODE_TYPES . AssignmentExpression ,
4242 } ,
4343 ] ,
44- output : "jest.spyOn(Date, 'now')" ,
44+ output : "jest.spyOn(Date, 'now').mockImplementation() " ,
4545 } ,
4646 {
4747 code : 'window[`${name}`] = jest[`fn`]()' ,
@@ -51,7 +51,7 @@ ruleTester.run('prefer-spy-on', rule, {
5151 type : AST_NODE_TYPES . AssignmentExpression ,
5252 } ,
5353 ] ,
54- output : 'jest.spyOn(window, `${name}`)' ,
54+ output : 'jest.spyOn(window, `${name}`).mockImplementation() ' ,
5555 } ,
5656 {
5757 code : "obj['prop' + 1] = jest['fn']()" ,
@@ -61,7 +61,7 @@ ruleTester.run('prefer-spy-on', rule, {
6161 type : AST_NODE_TYPES . AssignmentExpression ,
6262 } ,
6363 ] ,
64- output : "jest.spyOn(obj, 'prop' + 1)" ,
64+ output : "jest.spyOn(obj, 'prop' + 1).mockImplementation() " ,
6565 } ,
6666 {
6767 code : 'obj.one.two = jest.fn(); const test = 10;' ,
@@ -71,7 +71,8 @@ ruleTester.run('prefer-spy-on', rule, {
7171 type : AST_NODE_TYPES . AssignmentExpression ,
7272 } ,
7373 ] ,
74- output : "jest.spyOn(obj.one, 'two'); const test = 10;" ,
74+ output :
75+ "jest.spyOn(obj.one, 'two').mockImplementation(); const test = 10;" ,
7576 } ,
7677 {
7778 code : 'obj.a = jest.fn(() => 10)' ,
0 commit comments