-
Notifications
You must be signed in to change notification settings - Fork 938
Firestore: testing_hooks.ts: move some logic into testing_hooks_spi.ts #7543
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
Conversation
|
…lterMismatchCallback doesn't get mangled by rollup in renameInternals()
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (68,597 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
…ess.exit(1)` to fix truncated output
…runcatedLogOutputFix' into TestingHooksSpi
In #7149 a "testing hooks" class was added, which enables Firestore's integration tests to reach into the SDK's internals to validate behavior that is not visible from the public API surface. This original testing hooks implementation had two subtle problems:
This PR fixes all of these issues by putting the actual testing hooks logic behind an interface. Instead of depending on the actual testing hook logic, the SDK's internals instead depend on the "SPI" (the "service provider interface"), which is basically one global variable and a bunch of TypeScript interface declarations (which do not contribute to bundle size). The integration tests, however, have a strong dependency on the testing hooks logic and bear the bundle size cost of including that code, which is fine since they're just integration tests.
This PR was motivated by #7542, which suffered from both of the problems identified above.