Skip to content

Commit

Permalink
Remove unnecessary window mock
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Jan 20, 2024
1 parent ed1d21e commit 29d91c1
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/toolkit/src/tests/configureStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as DevTools from '@internal/devtoolsExtension'
import type { StoreEnhancer } from '@reduxjs/toolkit'
import { Tuple } from '@reduxjs/toolkit'
import type * as Redux from 'redux'
import type { MockInstance } from 'vitest'
import { vi } from 'vitest'

vi.doMock('redux', async (importOriginal) => {
Expand All @@ -16,20 +15,9 @@ vi.doMock('redux', async (importOriginal) => {
return redux
})

declare global {
interface Window {
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__: MockInstance<
Parameters<typeof DevTools.composeWithDevTools>,
ReturnType<typeof DevTools.composeWithDevTools>
>
}
}

describe('configureStore', async () => {
const composeWithDevToolsSpy = vi.spyOn(DevTools, 'composeWithDevTools')

window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = composeWithDevToolsSpy

const redux = await import('redux')

const { configureStore } = await import('@reduxjs/toolkit')
Expand Down

0 comments on commit 29d91c1

Please sign in to comment.