"done" should fail when called multiple times
See original GitHub issueI did some online searching and didn’t find any discussion, so let me know if this is as expected. Happy to do a PR if this should be correct behavior
🐛 Bug Report
Calling done()
multiple times in one test should be a failure, but it succeeds
To Reproduce
it('should fail when done called second time', done => {
done();
done();
});
Expected behavior
Test fails with "done" called multiple times
or some such message
Link to repl or repo (highly encouraged)
Above code snippet showcases issue. Looks like following test could be added to e2e failures:
test('done();done()', done => {
done();
done();
});
Run npx envinfo --preset jest
Paste the results here:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Binaries:
Node: 10.3.0 - /usr/local/bin/node
Yarn: 1.5.1 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Event-based unit tests fail with "done() called multiple times"
I have a simple async callback test that I've set up with mocha : describe('test', function () { it('should not work', function(done) {...
Read more >Unit Test calles multiple times done - Creating Nodes
Hello, i have a problem with a unit test. The node i develope sends msg in a loop like this: for( let i...
Read more >BuiltIn
Should Be Equal and Should Be Equal As Strings report the failures using unified diff format if both strings have more than two...
Read more >Events | Node.js v19.3.0 Documentation
Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
Read more >Spark Streaming Programming Guide
There is a newer and easier to use streaming engine in Spark called ... In this case, each line will be split into...
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
Hello, me and another student are trying to fix this issue for a course in college. However, it’s our first time working with jest so we are not so sure which files to run to reproduce this issue… Can you please replicate it in repl.it?
That would be great, thanks!