1.0.0 • Published 7 years ago

trampss-redux-saga-tester v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

trampss-redux-saga-tester

CircleCI Coverage Status NPM Version

Test your sagas (redux-saga) with ease, compatible with Jest snapshots !

Examples

import tester from 'trampss-redux-saga-tester'
import { search } from './mySaga'

describe('mySaga', () => {
  describe('search', () => {
    const test = tester(search)(/* saga params */)

    it('should search and set something', () => {
      const mocks = {
        call: [() => [{ id: 1, name: 'name 1' }, { id: 2, name: 'name 2' }]],
        select: [() => ({ some: 'form', value: true })],
      }

      expect(test(mocks)).toMatchSnapshot()
    })
  })
})