initializeTestApp
from @firebase/rules-unit-testing
with jest, file scope variables are unset
#3920
Labels
initializeTestApp
from @firebase/rules-unit-testing
with jest, file scope variables are unset
#3920
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
When I use
initializeTestApp
with the@firebase/rules-unit-testing
, any variables that I set in the root scope of the file are invalidated in jest tests. The first test will pass, but then, when the second test is run, andinitializeTestApp
is called, the second test won't pass because file scoped variables are unset.initializeTestApp
is removed, the test passes just fine.@firebase/rules-unit-testing
to@firebase/testing
, the test passes just fine.Likely Unrelated:
I'm doing this in an nx react application.
Steps to reproduce:
Run the given code sample with Jest. The second test will fail, even though it shouldn't, because
testData.uid
will be unset.Again, simply changing the import from
rules-unit-testing
totesting
fixes the problem.Relevant Code:
The text was updated successfully, but these errors were encountered: