Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awaiting promises in describe blocks makes mocha ignore following it blocks #4819

Closed
1 task done
manuschillerdev opened this issue Jan 24, 2022 · 1 comment
Closed
1 task done
Labels
duplicate been there, done that, got the t-shirt...

Comments

@manuschillerdev
Copy link

Prerequisites

  • [x ] Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
  • [ x] Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
  • [ x] 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
  • Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you not install Mocha globally.

Description

awaiting a promise in a describe block makes mocha ignores all following it blocks.
One can fix the behaviour by awaiting the promise inside another it or before block.

Steps to Reproduce

I created a minimal reproduction here:
https://stackblitz.com/edit/testing-mocha-b5uca7?file=src%2Findex.js

Expected behavior: [What you expect to happen]
awaiting the promise in the describe block should not make mocha ignore all following it blocks.

Actual behavior: [What actually happens]
awaiting the promise in the describe block leads to mocha never executing the following it blocks.

Reproduces how often:
consistently (100%)

Versions

  • The output of mocha --version and node node_modules/.bin/mocha --version: 8.4.0
  • The output of node --version: unknown (how can I detect that on stackblitz?)
@juergba juergba added duplicate been there, done that, got the t-shirt... and removed unconfirmed-bug labels Jan 24, 2022
@juergba
Copy link
Contributor

juergba commented Jan 24, 2022

duplicate of eg. #2975

@juergba juergba closed this as completed Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate been there, done that, got the t-shirt...
Projects
None yet
Development

No branches or pull requests

2 participants