We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Title should say jest not recognizing string template reducer.
jest
I have my reducer defined as such (simplified from real world use case to maintain main point)
export const setItem = createAction('@common//setItem'); const reducer = handleActions( { [`${setItem}`]: (state, action: Action) => !action.error ? action.payload : state, //other actions not shown }, null, );
This is a convenient way of reference the action type in sync with the defined action.
Problem is this seems to not work properly in jest. When defined this way the action is never triggered.
If I rewrite it to statically reference the action type
const reducer = handleActions( { [`@common/setItem`]: (state, action: Action) => !action.error ? action.payload : state, //other actions not shown }, null, );
This executes properly.
Anyway have any idea how I might fix this?
The text was updated successfully, but these errors were encountered:
You should be able to reference the action with setItem.toString(). If this is still an issue feel free to comment and I will reopen it.
setItem.toString()
Sorry, something went wrong.
No branches or pull requests
Title should say
jest
not recognizing string template reducer.I have my reducer defined as such (simplified from real world use case to maintain main point)
This is a convenient way of reference the action type in sync with the defined action.
Problem is this seems to not work properly in jest. When defined this way the action is never triggered.
If I rewrite it to statically reference the action type
This executes properly.
Anyway have any idea how I might fix this?
The text was updated successfully, but these errors were encountered: