Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save taverasmisael/8bea031e46c0cb6a1cb7ec772b7114a9 to your computer and use it in GitHub Desktop.
Save taverasmisael/8bea031e46c0cb6a1cb7ec772b7114a9 to your computer and use it in GitHub Desktop.
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