Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import reducer, { * as actionCreators } from './users'
describe('actions', () => {
it('adds a user', () => {
const user = {id:1, name:'Bat'}
const action = actionCreators.addUser(user)
expect(action).toEqual({type:'my-app/users/ADD', payload:user })
expect(reducer(undefined, action)).toMatchSnapshot('adds a user')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment