-
-
Save dmitryshelomanov/02afb9ad76a9868552e46f934fd34d6c to your computer and use it in GitHub Desktop.
react testing reducer
This file contains 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
it.only('counter COUNTER_PLUS state', () => { | |
const store = global.mockStore(INITIAL_STATE) | |
const actions = store.dispatch(plus(1)) | |
const testFn = counter(store.getState(), actions) | |
expect(testFn).toEqual({ | |
number: 1 | |
}) | |
expect(store.getActions()[0]).toEqual({ | |
type: types.COUNTER_PLUS, | |
payload: 1 | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment