import counter from '../../app/scripts/core/Counter.es6'; describe('counter', () => { it('should handle initial state', () => { expect ( counter(0, { type: 'INCREMENT_COUNTER' }) ).toEqual(1); }); it('should handle INCREMENT_COUNTER', () => { expect ( counter(1, { type: 'INCREMENT_COUNTER' }) ).toEqual(2); }); it('should handle DECREMENT_COUNTER', () => { expect ( counter(2, { type: 'DECREMENT_COUNTER' }) ).toEqual(1); }); it('should handle unknown action type', () => { expect ( counter(1, { type: 'SOMETHING_ELSE' }) ).toEqual(1); }); });