-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Hangs when using deasync #4466
Comments
I don't trust this |
Here's the results of the tests with different ways of running with Here's a test from running with the ESM support from node 14:
NOTE: If I added the |
That error with |
|
Btw I'm quite sure Mocha's |
Using
That comment was meant in relation to doing |
well, this hangs without mocha by renaming |
I really have no idea what is causing |
you could try |
Yes, I agree that I could rewrite this example is ways that would work using synchronous file operations, but this is just an example to demonstrate the problem I'm having reading from a database with calls that are only promise based. Also, I agree that I can do things to |
I think what's happening is that Node.js' native module system is taking over, when you want to be using
|
I am not sure what |
I'm going to close this, as it's an |
Just FYI, the update to 8.2.0 makes this happen with node 12 as well (even when using |
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Using
deasync
makes the code hang instead of runSteps to Reproduce
yarn test
and verify it works withoutmocha
yarn mocha
and verify that it hangs when running withmocha
Expected behavior: [What you expect to happen]
Runs to competition with
mocha
as it does withoutActual behavior: [What actually happens]
Running with
mocha
hangs and prevents us from being able to run our testsReproduces how often: [What percentage of the time does it reproduce?]
100%
Versions
mocha --version
andnode node_modules/.bin/mocha --version
: 8.1.3node --version
: 14.12.0Additional Information
We used to use
--require
to load the settings before the tests, but that doesn't work with native support for ESM in node 14 andesm
doesn't yet support optional chaining/nullish coalescing, so loading this "inline" (i.e. doing thedeasync
in the settings itself upon import) was a solution that worked for running our apps, but didn't work when running our tests inmocha
The text was updated successfully, but these errors were encountered: