Open kenkunz opened 2 years ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @kenkunz, thanks for the report. I was able to reproduce the behavior now. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share.
Thanks for the work around @kenkunz. I hit this bug when upgrading to the new 9.0 API
Noticed this is old but it is still an issue with firebase v9.9.3 and @firebase/rules-unit-testing v2.0.4 so it would be good to see an update or a fix here
Seems to be fixed with with the latest firebase 11.0.1
and @firebase/rules-unit-testing 4.0.0
.
@kenkunz,
Can you confirm that this was fixed in v11?
@kenkunz,
Can you confirm that this was fixed in v11?
Sorry, I haven't been actively using Firebase for a while, and don't have bandwidth to dust this off to test atm.
Ok, thanks @kenkunz.
I'll leave this issue open for now. If someone else has any more information then please post it here, otherwise I'll assume this is fixed and we'll let the bot auto close it in a few weeks.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
With
@firebase/rules-unit-testing@2.0.1
andfirebase >=9.0.0 <=9.1.3
, the test utilities work whether loaded as a cjs require or an es6 module. After upgrading tofirebase >=9.2.0
, the utilities no longer work when loaded as es6 module, but still work when loaded with cjs require.Since other firebase modules support es6 module loading, it seems surprising for rules-unit-testing not to fully support this as well.
Current workaround
Using cjs require for my firestore rules tests.
Steps to reproduce:
install dependency: Firebase Emulators
clone kenkunz/firestore-testing-repro and install npm modules
run the tests
Note that both
test.js
andtest.cjs
complete successfullyupgrade to
firebase@9.2.0
(or greater)run the tests again
Note that
test.cjs
still passes buttest.js
fails (see error output below)Error output: