redux-saga-beginner-tutorial
                                
                                 redux-saga-beginner-tutorial copied to clipboard
                                
                                    redux-saga-beginner-tutorial copied to clipboard
                            
                            
                            
                        error in test
error in the following test:
assert.deepEqual( gen.next().value, call(delay, 1000), 'incrementAsync Saga must call delay(1000)' )
this gen.next().value return a promise as value:
{ value: Promise { _c: [], _a: undefined, _s: 0, _d: false, _v: undefined, _h: 0, _n: false, '@@redux-saga/cancelPromise': [Function] }, done: false }
So the test fail
Getting the same error.
redux-saga error: uncaught at check call: argument [object Promise] is not a function /redux-saga-beginner-tutorial/node_modules/regenerator-runtime/runtime.js:537 throw exception;
This is disappointing :(
For newcomers: I was getting the same error and the problem was on the first line of incrementAsync(): yield call(delay(1000)) should be yield call(delay, 1000)
Thanks rodolfoag. Did you want to put in a pull request for your fix? Thanks
It still happens with me, even with the call(delay, 1000) instead of delay(1000) - in both places, btw.
Here is the error:

Note how expected and actual are exactly the same, at least by character to character visual inspection.
Meanwhile, I found this answer in StackOverflow:
https://stackoverflow.com/questions/49263089/how-to-test-redux-saga-delay
More specifically:

I suspected that something like that would be happening.
I fixed my problem by using this in both files (sagas.js and sagas.spec.js):
import { delay } from 'redux-saga'
instead of this:
const delay = ms => new Promise(res => setTimeout(res, ms))
I think the tutorial should be changed for this, too, as it not only fixes the issue, but also applies a bit of DRY philosophy to the code (not to mention the DRTW).