question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Testing: Mocha done() stops subsequent tests

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

At use the standard case with the Mocha done() function, subsequent tests are not run.

it('should work', (done) => {
     done();
});

it('should work too', () => {
     // will not be executed
});

Expected behavior

The subsequent tests should continue to run.

What is the motivation / use case for changing the behavior?

Ability to write tests using Mocha

Environment


Angular version: 5.2.3


Browser:
- [x] Chrome (desktop) version 64.0.3282.140
 
For Tooling issues:
- Node version: 8.9.4  
- Platform:  Windows 10

Others:
Angular CLI used as a test starter.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JiaLiPassioncommented, Feb 23, 2018

@NiKlimenko , thank you for posting the issue, it is a bug of zone.js not compatible with new version of mocha, I will fix it in zone.js.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 13, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Skip subsequent Mocha tests from spec if one fails
Mocha supports bailing after the first test failure, is that what you want? From mocha --help : -b, --bail bail after first test...
Read more >
Mocha test stops without further execution of other ... - GitHub
I have found the issue and solved it myself, it was the supertest plugin which was causing the issue when assert fails ,...
Read more >
Mocha test stops without further execution of ... - Google Groups
Mocha test stops without further execution of other test cases if an assert,expect or should fails in a test case. 1995 views.
Read more >
Mocha - the fun, simple, flexible JavaScript test framework
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run ......
Read more >
Getting Started with Node.js and Mocha - Semaphore Tutorial
Mocha is a simple, extensible and fast testing library for Node.js. ... Next, we will update the test command in package.json to contain...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found