Skip to content

Instantly share code, notes, and snippets.

@baptistemanson
Last active July 20, 2017 18:12
Show Gist options
  • Save baptistemanson/0429523bdb2b39338b53e3d38a24296e to your computer and use it in GitHub Desktop.
Save baptistemanson/0429523bdb2b39338b53e3d38a24296e to your computer and use it in GitHub Desktop.
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