Created
May 25, 2018 01:52
-
-
Save lmiller1990/1a59cff60f3a80df2e2a6f3432fd7b9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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