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

feat(auth, emulator): implement useEmulator with jest + e2e testing #4552

Merged
merged 8 commits into from
Nov 16, 2020

Conversation

mikehardy
Copy link
Collaborator

@mikehardy mikehardy commented Nov 15, 2020

Description

Implement firebase.auth().useEmulator

I'm about to release a major version anyway so I included the removal of deprecated analytics methods

I intend to rebase on to master so these will stay as separate commits and will be picked up correctly for release

It should be reviewed commit by commit for clarity

Phone flow and Email OOB code verification via new emulator APIs is implemented, increasing general test cover vs prior state

Related issues

#4461
#4463
#4510
#4551

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

This enabled me to turn on auth e2e testing again, and I implemented jest tests even though they were really difficult because of the native mocking need


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link

vercel bot commented Nov 15, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/kok0ug41t
✅ Preview: https://react-native-firebase-git-auth-emulator.invertase.vercel.app

@codecov
Copy link

codecov bot commented Nov 15, 2020

Codecov Report

Merging #4552 (b9d87ba) into master (a1e90ae) will increase coverage by 8.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4552      +/-   ##
==========================================
+ Coverage   69.10%   77.15%   +8.05%     
==========================================
  Files         109      109              
  Lines        3699     3710      +11     
  Branches      276      346      +70     
==========================================
+ Hits         2556     2862     +306     
+ Misses       1041      747     -294     
+ Partials      102      101       -1     

Salakar
Salakar previously approved these changes Nov 16, 2020
BREAKING CHANGE: switch to setScreenView, logPurchase, logViewPromotion, logRefund as needed
Native implementation is not complete in this commit, but that is next
This is related to a #4487 - attempting to re-login with credential
after anonymous user signs in with apple sign-in on android
…n CI

This was flaky because the app startup time is so slow it frequently times out the test
Runs fine locally
Found at least 2 unexpected real issues in RNFB along the way
Found at least 3 Firebase internal errors marked with FIXME that need upstream logging

Auth emulator is great, no API limits and now we can cover phone auth and email verify/signin flow in testing
mikehardy pushed a commit that referenced this pull request Sep 4, 2021
…om anon user (matches iOS) (#5694)

Description
When doing "linkWithCredential" in Android and the users exists relogin with this new user instead of launch exception 
Error: [auth/credential-already-in-use] This credential is already associated with a different user account.

Related  PR #4487 and PR #4552
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

Successfully merging this pull request may close these issues.

[🐛] Support Auth Emulator
2 participants