e651e9c797
* feat: store and component mocks setup * feat: more examples
24 lines
345 B
JavaScript
24 lines
345 B
JavaScript
jest.mock('store', () => {
|
|
let state = {}
|
|
|
|
const mockUseStore = (selectorFn) => {
|
|
return selectorFn(state)
|
|
}
|
|
|
|
mockUseStore.setState = (newState) => {
|
|
state = {
|
|
...state,
|
|
...newState,
|
|
}
|
|
}
|
|
|
|
mockUseStore.clearState = () => {
|
|
state = {}
|
|
}
|
|
|
|
return {
|
|
__esModule: true,
|
|
default: mockUseStore,
|
|
}
|
|
})
|