@@ -2,10 +2,11 @@ import * as DevTools from '@internal/devtoolsExtension'
2
2
import type { StoreEnhancer } from '@reduxjs/toolkit'
3
3
import { Tuple } from '@reduxjs/toolkit'
4
4
import type * as Redux from 'redux'
5
+ import type { MockInstance } from 'vitest'
5
6
import { vi } from 'vitest'
6
7
7
- vi . doMock ( 'redux' , async ( ) => {
8
- const redux : any = await vi . importActual ( 'redux' )
8
+ vi . doMock ( 'redux' , async ( importOriginal ) => {
9
+ const redux = await importOriginal < typeof import ( 'redux' ) > ( )
9
10
10
11
vi . spyOn ( redux , 'applyMiddleware' )
11
12
vi . spyOn ( redux , 'combineReducers' )
@@ -15,10 +16,19 @@ vi.doMock('redux', async () => {
15
16
return redux
16
17
} )
17
18
19
+ declare global {
20
+ interface Window {
21
+ __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : MockInstance <
22
+ Parameters < typeof DevTools . composeWithDevTools > ,
23
+ ReturnType < typeof DevTools . composeWithDevTools >
24
+ >
25
+ }
26
+ }
27
+
18
28
describe ( 'configureStore' , async ( ) => {
19
29
const composeWithDevToolsSpy = vi . spyOn ( DevTools , 'composeWithDevTools' )
20
30
21
- ; ( window as any ) . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = composeWithDevToolsSpy
31
+ window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = composeWithDevToolsSpy
22
32
23
33
const redux = await import ( 'redux' )
24
34
0 commit comments