Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test.wrap(fn, [?]) to call as anonymous client? #90

Open
SrBrahma opened this issue Mar 7, 2021 · 2 comments
Open

How to test.wrap(fn, [?]) to call as anonymous client? #90

SrBrahma opened this issue Mar 7, 2021 · 2 comments
Labels
Needs: Author Feedback Issues awaiting author feedback

Comments

@SrBrahma
Copy link

SrBrahma commented Mar 7, 2021

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.

@taeold
Copy link
Contributor

taeold commented Oct 4, 2021

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.

@taeold taeold added the Needs: Author Feedback Issues awaiting author feedback label Oct 4, 2021
@SrBrahma
Copy link
Author

SrBrahma commented Oct 5, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Issues awaiting author feedback
Projects
None yet
Development

No branches or pull requests

2 participants