Created
June 30, 2018 18:35
-
-
Save lupomontero/d20377779d72687cc04a4b8f7a29740d 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
const reducer = require('./reducer-0'); | |
describe('reducer()', () => { | |
it('should handle increment and decrement actions', () => { | |
expect(reducer({ type: 'INCREMENT' })).toEqual({ count: 1 }); | |
expect(reducer({ type: 'INCREMENT' })).toEqual({ count: 2 }); | |
expect(reducer({ type: 'DECREMENT' })).toEqual({ count: 1 }); | |
}); | |
it('should depend on prevous invocations (history) - unpredictable!', () => { | |
// El estado va a depender de si se ha ejecutado el test | |
// anterior o no!! | |
expect(reducer({ type: 'INCREMENT' })).toEqual({ count: 2 }); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment