Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
improved test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jun 20, 2016
1 parent 73d2bfa commit 2ac76a7
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions test/watchers/watchRequests.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import expect from 'expect'
import { channel } from 'redux-saga'
import { call, fork } from 'redux-saga/effects'
import { call, fork, put, take } from 'redux-saga/effects'

import { watchRequests } from '../../src'
import { REQUEST, watchRequests } from '../../src'
import { processRequest } from '../../src/workers'

describe('watchRequests', () => {
Expand All @@ -26,6 +26,26 @@ describe('watchRequests', () => {
).toEqual(
fork(processRequest, socket, chan, retries)
)
expect(
iterator.next(chan).value
).toEqual(
fork(processRequest, socket, chan, retries)
)
})
it('should take requests and put them on the channel', () => {
const payload = {
type: 'REQUEST',
payload: { successType: 'SUCCESS', failureType: 'FAILURE' },
}
expect(
iterator.next().value
).toEqual(
take(REQUEST)
)
expect(
iterator.next(payload).value
).toEqual(
put(chan, payload)
)
})
it('should take requests and put them on the channel')
})

0 comments on commit 2ac76a7

Please sign in to comment.