-
Notifications
You must be signed in to change notification settings - Fork 0
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 Emulator #378
Merged
Merged
Firebase Emulator #378
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOL THE CI TEST FAILED. That's funny. Probably some setup failure. edit: nvm it was me from a year ago being stupid. I made a unit test with randomness and didn't account for Murphy's Law |
JasonIsAzn
approved these changes
Jun 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We could look into the rules issue later but not a high priority right now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moves unit tests from using the production database to an emulator.
This PR sets up the framework for unit tests to test various firebase functions as well as use emulators for internal testing.
A big feature that this implements is the ability for the app to be able to connect to an emulator. This means that once the app is live, we will no longer have the need to use the production database for
To use the emulator, various environment variables must be set in
.env
. These define various places where the app/testing environment will connect. The only lines that need to be added are the emulators that are being connected to. For example, you can use the production auth service (recommended) while still using the firestore emulator service:Note: campus wifi does not allow hosting, so in order to use the emulator on campus, the user must come up with a method to connect to the emulator via LAN or other methods.
The testing framework also mocks
firebase/auth
as the current implementation contains require cycles which mess with jest. Hopefully this changes in the future, but for now auth does not have full functionality in testing.