You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
20 lines
539 B
TypeScript
20 lines
539 B
TypeScript
import { createStore } from 'redux';
|
|
import appDefaultState from '../appDefaultState';
|
|
import Setting from '@joplin/lib/models/Setting';
|
|
import { AppState } from '../types';
|
|
import appReducer from '../appReducer';
|
|
|
|
const testReducer = (state: AppState|undefined, action: unknown): AppState => {
|
|
state ??= {
|
|
...appDefaultState,
|
|
settings: Setting.toPlainObject(),
|
|
};
|
|
|
|
return { ...state, ...appReducer(state, action) };
|
|
};
|
|
|
|
const createMockReduxStore = () => {
|
|
return createStore(testReducer);
|
|
};
|
|
export default createMockReduxStore;
|