mars-v2-frontend/__mocks__/store.js
Yusuf Seyrek e651e9c797
feat: store and component mocks setup (#237)
* feat: store and component mocks setup

* feat: more examples
2023-05-30 11:16:13 +02:00

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,
}
})