Created
June 27, 2016 12:55
-
-
Save skellock/e55bed3b1716d35ccf6fef386ddb2676 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
import test from 'ava' | |
import reducer from './CounterReducer' | |
test('increment from a fresh state', t => { | |
const state = reducer(undefined, { type: 'INCREMENT' }) | |
t.deepEqual(state, { value: 1 }) | |
}) | |
test('increment from a previous state', t => { | |
const state = reducer({ value: 68 }, { type: 'INCREMENT' }) | |
t.deepEqual(state, { value: 69 }) | |
}) | |
test('play nicely with other reducers', t => { | |
const previousState = { value: 9000 } | |
const state = reducer(previousState, { type: 'NONE' }) | |
t.is(state, previousState) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment