@@ -5,12 +5,12 @@ import * as rtl from '@testing-library/react'
55import type { Dispatch , ElementType , MouseEvent , ReactNode } from 'react'
66import React , { Component } from 'react'
77import type {
8- Action ,
9- AnyAction ,
10- MiddlewareAPI ,
11- Dispatch as ReduxDispatch ,
12- Store ,
13- UnknownAction ,
8+ Action ,
9+ AnyAction ,
10+ MiddlewareAPI ,
11+ Dispatch as ReduxDispatch ,
12+ Store ,
13+ UnknownAction ,
1414} from 'redux'
1515import { applyMiddleware , createStore } from 'redux'
1616import type { ReactReduxContextValue } from '../../src/index'
@@ -199,7 +199,7 @@ describe('React', () => {
199199 string : state ,
200200 } ) ) ( Container )
201201
202- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
202+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
203203
204204 const tester = rtl . render (
205205 < ProviderMock store = { store } >
@@ -243,7 +243,7 @@ describe('React', () => {
243243 string : state ,
244244 } ) ) ( Container )
245245
246- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
246+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
247247 const tester = rtl . render (
248248 < ProviderMock store = { store as unknown as Store } >
249249 < ConnectedContainer />
@@ -261,7 +261,7 @@ describe('React', () => {
261261 } )
262262
263263 it ( 'should throw an error if the store is not in the props or context' , ( ) => {
264- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
264+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
265265
266266 class Container extends Component {
267267 render ( ) {
@@ -643,7 +643,7 @@ describe('React', () => {
643643 }
644644 class AwesomeMap { }
645645
646- let spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
646+ let spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
647647 rtl . render (
648648 < ProviderMock store = { store } >
649649 { makeContainer (
@@ -660,7 +660,7 @@ describe('React', () => {
660660 spy . mockRestore ( )
661661 rtl . cleanup ( )
662662
663- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
663+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
664664 rtl . render (
665665 < ProviderMock store = { store } >
666666 { makeContainer (
@@ -677,7 +677,7 @@ describe('React', () => {
677677 spy . mockRestore ( )
678678 rtl . cleanup ( )
679679
680- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
680+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
681681 rtl . render (
682682 < ProviderMock store = { store } >
683683 { makeContainer (
@@ -694,7 +694,7 @@ describe('React', () => {
694694 spy . mockRestore ( )
695695 rtl . cleanup ( )
696696
697- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
697+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
698698 rtl . render (
699699 < ProviderMock store = { store } >
700700 { makeContainer (
@@ -711,7 +711,7 @@ describe('React', () => {
711711 spy . mockRestore ( )
712712 rtl . cleanup ( )
713713
714- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
714+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
715715 rtl . render (
716716 < ProviderMock store = { store } >
717717 { makeContainer (
@@ -728,7 +728,7 @@ describe('React', () => {
728728 spy . mockRestore ( )
729729 rtl . cleanup ( )
730730
731- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
731+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
732732 rtl . render (
733733 < ProviderMock store = { store } >
734734 { makeContainer (
@@ -745,7 +745,7 @@ describe('React', () => {
745745 spy . mockRestore ( )
746746 rtl . cleanup ( )
747747
748- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
748+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
749749 rtl . render (
750750 < ProviderMock store = { store } >
751751 { makeContainer (
@@ -762,7 +762,7 @@ describe('React', () => {
762762 spy . mockRestore ( )
763763 rtl . cleanup ( )
764764
765- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
765+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
766766 rtl . render (
767767 < ProviderMock store = { store } >
768768 { makeContainer (
@@ -779,7 +779,7 @@ describe('React', () => {
779779 spy . mockRestore ( )
780780 rtl . cleanup ( )
781781
782- spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
782+ spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
783783 rtl . render (
784784 < ProviderMock store = { store } >
785785 { makeContainer (
@@ -1297,7 +1297,7 @@ describe('React', () => {
12971297 </ ProviderMock > ,
12981298 )
12991299
1300- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
1300+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
13011301 rtl . act ( ( ) => {
13021302 linkA . current ! . click ( )
13031303 linkB . current ! . click ( )
@@ -1345,7 +1345,7 @@ describe('React', () => {
13451345 )
13461346 expect ( mapStateToPropsCalls ) . toBe ( 1 )
13471347
1348- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
1348+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
13491349 unmount ( )
13501350 expect ( spy ) . toHaveBeenCalledTimes ( 0 )
13511351 expect ( mapStateToPropsCalls ) . toBe ( 1 )
@@ -1380,7 +1380,7 @@ describe('React', () => {
13801380 } )
13811381
13821382 expect ( mapStateToPropsCalls ) . toBe ( 1 )
1383- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
1383+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
13841384 rtl . act ( ( ) => {
13851385 store . dispatch ( { type : 'APPEND' , body : 'a' } )
13861386 } )
@@ -1456,7 +1456,7 @@ describe('React', () => {
14561456 describe ( 'Performance optimizations and bail-outs' , ( ) => {
14571457 it ( 'should shallowly compare the selected state to prevent unnecessary updates' , ( ) => {
14581458 const store : Store = createStore ( stringBuilder )
1459- const spy = jest . fn ( ( ) => ( { } ) )
1459+ const spy = vi . fn ( ( ) => ( { } ) )
14601460 interface RenderProps {
14611461 string : string
14621462 }
@@ -1511,7 +1511,7 @@ describe('React', () => {
15111511
15121512 it ( 'should shallowly compare the merged state to prevent unnecessary updates' , ( ) => {
15131513 const store : Store = createStore ( stringBuilder )
1514- const spy = jest . fn ( ( ) => ( { } ) )
1514+ const spy = vi . fn ( ( ) => ( { } ) )
15151515 interface PassObjType {
15161516 val ?: string
15171517 prop ?: string
@@ -2023,7 +2023,7 @@ describe('React', () => {
20232023 }
20242024 }
20252025
2026- const mapStateToProps = jest . fn ( ( state ) => ( { count : state } ) )
2026+ const mapStateToProps = vi . fn ( ( state ) => ( { count : state } ) )
20272027
20282028 interface ChildrenTStateProps {
20292029 count : RootStateType
@@ -2089,7 +2089,7 @@ describe('React', () => {
20892089 }
20902090 type ChildNoDisPatch = { }
20912091 type ChildOwnProps = { }
2092- const mapStateToProps = jest . fn ( ( state ) => ( { count : state } ) )
2092+ const mapStateToProps = vi . fn ( ( state ) => ( { count : state } ) )
20932093 class Child extends Component < ChildTStateProps > {
20942094 render ( ) {
20952095 return < div > { this . props . count } </ div >
@@ -2284,9 +2284,9 @@ describe('React', () => {
22842284 }
22852285 type ActionType = UnknownAction
22862286 type NoDispatchType = { }
2287- const c3Spy = jest . fn ( )
2288- const c2Spy = jest . fn ( )
2289- const c1Spy = jest . fn ( )
2287+ const c3Spy = vi . fn ( )
2288+ const c2Spy = vi . fn ( )
2289+ const c1Spy = vi . fn ( )
22902290
22912291 type Comp3TStatePropsType = Store1State1Type
22922292 type Comp3NoDispatchType = NoDispatchType
@@ -2442,7 +2442,7 @@ describe('React', () => {
24422442 } ,
24432443 ) ( A )
24442444
2445- const mapStateToPropsB = jest . fn ( ( state ) => ( { count : state } ) )
2445+ const mapStateToPropsB = vi . fn ( ( state ) => ( { count : state } ) )
24462446 class B extends Component {
24472447 render ( ) {
24482448 return < ConnectedC { ...this . props } />
@@ -2452,7 +2452,7 @@ describe('React', () => {
24522452 context : customContext ,
24532453 } ) ( B )
24542454
2455- const mapStateToPropsC = jest . fn ( ( state ) => ( { count : state } ) )
2455+ const mapStateToPropsC = vi . fn ( ( state ) => ( { count : state } ) )
24562456 class C extends Component {
24572457 render ( ) {
24582458 return < ConnectedD />
@@ -2467,7 +2467,7 @@ describe('React', () => {
24672467 }
24682468 type DNoDispatchType = { }
24692469 type DOwnPropsType = { }
2470- const mapStateToPropsD = jest . fn ( ( state ) => ( { count : state } ) )
2470+ const mapStateToPropsD = vi . fn ( ( state ) => ( { count : state } ) )
24712471 class D extends Component < DTStatePropsType > {
24722472 render ( ) {
24732473 return < div > { this . props . count } </ div >
@@ -2812,7 +2812,7 @@ describe('React', () => {
28122812 describe ( 'Error handling for invalid arguments' , ( ) => {
28132813 function renderWithBadConnect ( Component : ElementType ) {
28142814 const store = createStore ( ( ) => ( { } ) )
2815- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
2815+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
28162816
28172817 try {
28182818 rtl . render (
@@ -2885,7 +2885,7 @@ describe('React', () => {
28852885 if ( ! React . StrictMode ) {
28862886 return
28872887 }
2888- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
2888+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
28892889 const store : Store = createStore ( stringBuilder )
28902890
28912891 class Container extends Component {
@@ -2917,7 +2917,7 @@ describe('React', () => {
29172917 } )
29182918
29192919 it ( 'should warn one-time-only that `pure` options has been removed' , ( ) => {
2920- const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
2920+ const spy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
29212921 const store : Store = createStore ( stringBuilder )
29222922
29232923 class ContainerA extends Component {
0 commit comments