I see that in v7.2 changes were made to replace the deprecated @firebase/testing package with @firebase/rules-unit-testing but I am confused by the change. It seems to me that merely changing
import * as testing from '@firebase/testing'
to
import * as testing from '@firebase/rules-unit-testing'
should fail as the API changed and initializeAdminApp() no longer exists. The documentation has not been updated to show what is the correct way to initialize now and I do not see any tests. Is injectTestingAdaptor() still supported?
I had guess that perhaps I should use something like this:
But that fails with the error TypeError: Cannot read property 'DocumentReference' of undefined inside injectTestingAdaptor when creating the AdaptorConsts with this code:
I see that in v7.2 changes were made to replace the deprecated
@firebase/testing
package with@firebase/rules-unit-testing
but I am confused by the change. It seems to me that merely changingto
and then continuing to use
should fail as the API changed and
initializeAdminApp()
no longer exists. The documentation has not been updated to show what is the correct way to initialize now and I do not see any tests. IsinjectTestingAdaptor()
still supported?I had guess that perhaps I should use something like this:
But that fails with the error
TypeError: Cannot read property 'DocumentReference' of undefined
insideinjectTestingAdaptor
when creating the AdaptorConsts with this code:testing
here is as above. There is nofirestore
member in the API exposed by '@firebase/rules-unit-testing'.Note: I am using @SrBrahma's fork (installed via
yarn add typesaurus@srbrahma/typesaurus#lib
) but the the source forinjectTestingAdapter
is identical to the master branch here. (https://github.com/kossnocorp/typesaurus/blob/7ec7091da299592751bca055bc7158e0d8ccaa2a/src/testing/index.ts#L38)