-
Notifications
You must be signed in to change notification settings - Fork 909
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
Add mockUserToken support for database emulator. #4792
Conversation
🦋 Changeset detectedLatest commit: dc72577 The changes in this PR will be included in the next version bump. This PR includes changesets to release 37 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
/* eslint-disable camelcase */ | ||
|
||
describe('createMockUserToken()', () => { | ||
it('creates a well-formed JWT', () => { |
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.
Migrated from an old rules unit testing library test
Size Analysis Report |
3b35faa
to
4d8b954
Compare
Binary Size ReportAffected SDKs
Test Logs
|
Co-authored-by: Sebastian Schmidt <mrschmidt@google.com>
Co-authored-by: Sebastian Schmidt <mrschmidt@google.com>
Changeset File Check ✅
|
POC for new API with RTDB first.
Open questions
With this implementation, it doesn't look too challenging to support changing the mock token through repeated calls of
useEmulator(host, port, {mockUserToken})
(provided thathost
andport
stays the same). However, there are further implications for the underlying requests (e.g. pending requests or retries). I'd prefer we have a discussion before proceeding with a separate PR.Testing
Unit testing in
@firebase/util
done, manually tested end to end for@firebase/database
API Changes
Internally approved. See go/firebase-rules-unit-testing-next-api (Googlers only)