Open mis8680 opened 5 years ago
I found some weird issue with auth() mock object. Here is my code:
auth()
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
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.
firebase-mock
async/await
mocha
I have the same issue D:
mockauth.autoFlush(1); should do the trick.
mockauth.autoFlush(1);
I found some weird issue with
auth()
mock object. Here is my code:The
admin.auth().createUser
fails without any error. but If I update the code with this, It works.I wonder If
firebase-mock
supportasync/await
?! I am usingmocha
to test.