Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created May 25, 2018 01:52
Show Gist options
  • Select an option

  • Save lmiller1990/1a59cff60f3a80df2e2a6f3432fd7b9f to your computer and use it in GitHub Desktop.

Select an option

Save lmiller1990/1a59cff60f3a80df2e2a6f3432fd7b9f to your computer and use it in GitHub Desktop.
// store.js
const state = {
first: "",
last: ""
}
export const getters = {
message: (state) => {
return state.first + ' ' + state.last
}
}
// test
import { getters } from './store'
describe('message getter', () => {
it('returns hello world', () => {
const state = { first: 'hello', last: 'world' }
const actual = getters.message(state)
expect(actual).toBe('hello world')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment