© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Abraham Earls
Learning to code
What sort of tests do you write; for action creators, reducers; how do you pass along actions when testing your reducers?
Basically what I am looking for is a checklist for React/Redux testing!
Camilo Orrego
Front-end Development (but I want to do Back-end too)
Redux is easy for pure functions (basically action creators that return objects and reducers).
const addTodo = (todo) => ({ type: 'ADD_TODO', todo }); expect(addTodo({ foo: 'bar' })).toEqual({ type: 'ADD_TODO', todo: { foo: 'bar' } });
Reducers is the same. Just call the function with a initial state and an action and check the returned object.
When it comes to action creators with thunks, it's a little harder. You can check here:
Your title here
Finally, for React you can use the tools that facebook gives you. I personally like Enzyme.
Camilo Orrego
Front-end Development (but I want to do Back-end too)
Redux is easy for pure functions (basically action creators that return objects and reducers).
const addTodo = (todo) => ({ type: 'ADD_TODO', todo }); expect(addTodo({ foo: 'bar' })).toEqual({ type: 'ADD_TODO', todo: { foo: 'bar' } });Reducers is the same. Just call the function with a initial state and an action and check the returned object.
When it comes to action creators with thunks, it's a little harder. You can check here:
Your title here
Finally, for React you can use the tools that facebook gives you. I personally like Enzyme.