firebase-functions-test
firebase-functions-test copied to clipboard
How to test.wrap(fn, [?]) to call as anonymous client?
Version info
firebase-functions-test:"0.2.3"
firebase-functions:"3.11.0"
firebase-admin:"9.1.1"
I can make an authed call test by using test.wrap(fn)(data, {auth: uid: 'anyUid'}), but I also need to test for anonymous authentication call. How can I do it? Is it possible?
Sorry for questioning here, but emailing firebase for those more advanced questions takes some time and some emails for them to understand the point.
Hi @SrBrahma. I'm not sure what is being asked here - can you clarify for us?
For wrapped functions allows you to pass arbitrary javascript object under the auth property. So in your unit test, you can pass whatever property you are using to support calls from anonymous users.
It would help to have an example for the test case you are considering.
As far as I remember, I was needing back then a way to test function made by anon authed users, so I needed a way to be a anon authed user when calling the function, in a test env.
I personally don't need this anymore as I am no longer deving this app and my current one doesn't have anon users.