Skip to content

Instantly share code, notes, and snippets.

@kuroski
Last active September 8, 2018 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuroski/d1d0c1e82f8bfb94eff86cc7c2eb738e to your computer and use it in GitHub Desktop.
Save kuroski/d1d0c1e82f8bfb94eff86cc7c2eb738e to your computer and use it in GitHub Desktop.
import mutations from '@/store/mutations'
import initialState from '@/store/state'
import user from './fixtures/user'
describe('mutations', () => {
let state
beforeEach(() => {
state = { ...initialState }
})
it('sets new user', () => {
// arrange
const expectedUser = user
// act
mutations.SET_USER(state, expectedUser)
// assert
expect(state.user).toEqual(expectedUser)
expect(state.user).not.toBe(expectedUser)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment