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().createUser fails silently when it has await #141

Open
mis8680 opened this issue Apr 9, 2019 · 2 comments
Open

firebase.auth().createUser fails silently when it has await #141

mis8680 opened this issue Apr 9, 2019 · 2 comments

Comments

@mis8680
Copy link

mis8680 commented Apr 9, 2019

I found some weird issue with auth() mock object. Here is my code:

const mocksdk = firebasemock.MockFirebaseSdk(null, function () {
    return mockauth;
}, function () {
    return mockfirestore;
});

const seedTestData = proxyquire('../seedData', {
    'firebase-admin': mocksdk
});
const userDoc = await admin.auth().createUser({
            uid: `user_${i}`,
            email: emailAddress,
            emailVerified: true,
            password: 'password',
            displayName: `${firstName} ${lastName}`,
            disabled: false
        });

The admin.auth().createUser fails without any error. but If I update the code with this, It works.

admin.auth().createUser({
            uid: `user_${i}`,
            email: emailAddress,
            emailVerified: true,
            password: 'password',
            displayName: `${firstName} ${lastName}`,
            disabled: false
        }).then((user) => {
            console.log("created user: ", user);
        });

I wonder If firebase-mock support async/await?! I am using mocha to test.

@mis8680 mis8680 changed the title firebase.auth().createUser fails when it has await firebase.auth().createUser fails silently when it has await Apr 9, 2019
@jorgeeferreyra
Copy link

I have the same issue D:

@lgan1989
Copy link

lgan1989 commented Nov 5, 2020

mockauth.autoFlush(1);
should do the trick.

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

3 participants