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
Jest + @firebase/rules-unit-testing has unstopped asynchronous operations #4884
Comments
for a workaround, this is what I have been using in my database tests. It's been working for me:
The |
@Francesco-Lanciana, thanks for the report. Would you mind creating and sharing a sample project that I can run locally to replicate the issue? |
Hey @looptheloop88 here is a minimum sample project that replicates the issue. Looking forward to hearing how you go with it. I'm very keen to get this bug fixed! |
Hi @Francesco-Lanciana, thanks for providing the MVCE. I appreciate it. I was able to reproduce the warning and informed our engineers about this. In the meantime, you can get rid of the warning using the workaround provided by @daniel-sudz. |
@Francesco-Lanciana Since both Jest and Firebase are mentioned, I'll use this opportunity. I have today released 0.0.3 beta of a tool that intends to make testing Firebase backends - Security Rules in particular - easy and fast. https://www.npmjs.com/package/firebase-jest-testing/v/0.0.3-beta.1
|
@Francesco-Lanciana or @inf3rnus does calling |
Hi @samtstern, I tried adding |
I had a look at @Francesco-Lanciana 's sample, simplified it a bit, and eventually came to jestjs/jest#11464 (comment) which imho is closest to the root cause of this.. My experience differs from the OP in that Other conclusions / tidbits:
|
Thanks @akauppi and @Francesco-Lanciana for the information, seems like there's something else going on here! |
I managed to fix this, on my tool's side, today. Here's the code: I tap to the |
Has there been any movement around this? I also have the issue, and don't use afterAll(async () => {
await Promise.all(admin.apps.map((app) => app?.delete()));
}); but that also doesn't work. The Without fixing the issue, the test process hangs indefinitely in CI. This is a pretty significant blocker, any chance this could be investigated more by the engineering team? |
I also ran into this issue however |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
When using
@firebase/rules-unit-testing
andjest
the tests will not exit cleanly and you will get the warning:Jest did not exit one second after the test run has completed.
. Deleting the apps after the tests have finished does not help.Steps to reproduce:
firebase emulators:start
ts-jest
and@types/jest
to write my tests using typescript.jest
command and you will get the following warning:--detectOpenHandles
does not help at all, it just hangs instead of exiting.I tried to delete every app after each test in order to close any asynchronous calls but that also didn't help.
Relevant Code:
The text was updated successfully, but these errors were encountered: