We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc02c71 commit 73495d2Copy full SHA for 73495d2
test/testUtils.ts
@@ -0,0 +1,16 @@
1
+import { addReactStore } from '../src/utils/reactStoreEnhancer'
2
+import { createStore as reduxCreateStore } from 'redux'
3
+import { configureStore } from '@reduxjs/toolkit'
4
+import type { Reducer } from 'redux'
5
+
6
+export function createTestStore(reducer: Reducer, preloadedState?: any) {
7
+ return reduxCreateStore(reducer, preloadedState, addReactStore)
8
+}
9
10
+// For RTK tests
11
+export function configureTestStore(options: any) {
12
+ return configureStore({
13
+ ...options,
14
+ enhancers: (getDefault) => getDefault().concat(addReactStore),
15
+ })
16
0 commit comments