Created
December 19, 2019 14:11
-
-
Save taverasmisael/8bea031e46c0cb6a1cb7ec772b7114a9 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 reduce from './reducer' | |
// Use `describe` to group similar tests | |
describe ('REDUCER', () => { | |
// The `it` blocks represent one test and although they can | |
// have several expects it is recommended that you only have one | |
// or that at least all the expects blocks are related, as in this case. | |
it ('should set the right state on "DO_REQUEST"', () => { | |
const newState = reducer(undefined, {type: 'DO_REQUEST'}) | |
expect (newState.error).toBe('') | |
expect (newState.data).toEqual([]) | |
expect (newState.isLoading).toBe(true) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment