Open Chralu opened 2 years ago
I would like to write automated e2e tests to validate my cloud functions using Firebase emulators.
With @firebase/rules-unit-testing v1, I could easily get a Functions context with fake authentication :
@firebase/rules-unit-testing v1
Functions
const app = initializeTestApp({ projectId: MY_PROJECT_ID, auth: { uid: "my_uid"} }) app.functions().useEmulator("localhost", 5001) const funcToTest = app.functions().httpsCallable("myFunctionToTest") // Do some tests
With @firebase/rules-unit-testing v2, there is no way to do the same :
@firebase/rules-unit-testing v2
const testEnv = await initializeTestEnvironment({ projectId: MY_PROJECT_ID, }) const authenticatedContext = testEnv.authenticatedContext("my_uid") //There is no `authenticatedContext.functions()` accessor
This seems extremely problematic to me, since it makes cloud functions e2e testing a real pain.
I would be happy to talk about this with you :)
Are there any updates on this?
Describe your environment
Describe the problem
I would like to write automated e2e tests to validate my cloud functions using Firebase emulators.
With
@firebase/rules-unit-testing v1
, I could easily get aFunctions
context with fake authentication :With
@firebase/rules-unit-testing v2
, there is no way to do the same :This seems extremely problematic to me, since it makes cloud functions e2e testing a real pain.
I would be happy to talk about this with you :)