You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typescript: Returned types from firebaseTestEnvironment.authenticatedContext(...).firestore() are incompatible with modular v9 client SDK Firestore types #5550
In addition to the already fixed #5500, when using the modular v9 client SDK, the "Firestore" type returned by firebaseTestEnvironment.authenticatedContext(...).firestore() from @firebase/rules-unit-testingv2.0.1 is incompatible with the modular client SDK type "Firestore".
Steps to reproduce:
Compile the relevant code below using
"@firebase/rules-unit-testing": "2.0.1",
"firebase": "9.1.0",
Relevant Code:
import{initializeTestEnvironment,RulesTestEnvironment}from'@firebase/rules-unit-testing'import{FirestoreasClientFirestore}from'firebase/firestore'letdb: ClientFirestoreletfirebaseTestEnvironment: RulesTestEnvironmentconstrulesContent=fs.readFileSync(path.resolve(__dirname,'../../../firestore.rules'),'utf8')firebaseTestEnvironment=awaitinitializeTestEnvironment({projectId: 'anyproj',firestore: {rules: rulesContent,},})// This line fails to compile with "Type 'Firestore' is missing the following properties from type 'Firestore': type, toJSONts(2739)"db=firebaseTestEnvironment.authenticatedContext('testuid',{}).firestore()