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

Firebase Auth module has a different structure with Firebase-Admin Auth module #108

Open
johnkingzy opened this issue Jun 8, 2021 · 0 comments

Comments

@johnkingzy
Copy link

johnkingzy commented Jun 8, 2021

Description

You all did a great job with mocking two modules which are

  • firebase &
  • firebase-admin

KUDOS 👍 🏆

However, there is an assumption that the Auth module in the firebase module would be the same as the Auth module in firebase-admin but they are different i.e with different methods and properties

For more clarity:
This is the Auth module for Firebase Admin
This is the Auth module for Firebase

if you scroll to methods, you will see that the method list is different.

Steps to reproduce

Try to use the auth module from firebase-admin, e.g

import * as admin from 'firebase-admin';
admin.initializeApp();

const auth = admin.auth();

auth.createUser({ email: '[email protected]', password: 'password', displayName: 'john doe' })

Expected result

  • Have createUser built-in as part of the FakeAuth class
    OR
  • Create the flexibility to pass it in as a property in the overrides object

Actual result

TypeError: firebase_1.auth.createUser is not a function

Here is a link to a possible workaround solution
https://gist.github.com/johnkingzy/9097b5b65fc8a472ed51a35d7a0aba45
TLDR: I redefined the FakeAuth class to match the module structure for firebase-admin

Environment

  • Local
  • Node version: v15.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant