-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Description
I have a scenario in which a method uses Store Helper to get State. When I try to test the function using the mock store which I have created, it uses the original store instance ( since it is in a helper file).
code.js
export const testFunction() {
const res = getValueFromHelper();
console.log(res);
}
helper.js
export const getValueFromHelper = () => store.getState.SomeReducer;
code.test.js
const store = mockStore({ SomeReducer:{} })
console.log(store.getState().SomeReducer); // Here value is correct
testFunction(); // But here it returning original state value
Metadata
Metadata
Assignees
Labels
No labels