error in test
See original GitHub issueerror 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
The Six Types of Test-Taking Errors
The Six Types of Test-Taking Errors · Misread direction errors - these errors occur when you skip directions or misunderstand directions but answer...
Read more >Type I and type II errors - Wikipedia
In statistical hypothesis testing, a type I error is the mistaken rejection of an actually true null hypothesis (also known as a "false...
Read more >Software Testing Errors to look out for (with examples)
In this article, we discuss some common software testing errors that a tester should be aware of. These errors are explained with examples...
Read more >Error checking test - 123Test
Free Error checking test online. Get explanations of the right answers to all questions. Practice Error checking for upcoming iq tests.
Read more >Types of Errors in Hypothesis Testing - Statistics By Jim
In this blog post, you will learn about the two types of errors in hypothesis testing, their causes, and how to manage them....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For newcomers: I was getting the same error and the problem was on the first line of incrementAsync():
yield call(delay(1000))
should beyield call(delay, 1000)
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).