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

Fix analytics test warnings #8556

Merged
merged 2 commits into from
Oct 2, 2024
Merged

Fix analytics test warnings #8556

merged 2 commits into from
Oct 2, 2024

Conversation

hsubox76
Copy link
Contributor

@hsubox76 hsubox76 commented Oct 1, 2024

Analytics test logs had a lot of spam with warnings that the app is already deleted. This actually didn't come from a call to deleteApp() but a reference to app.name (which is actually a getter function) in a heartbeatService method. This is because some of the analytics tests use a full FirebaseApp initialized with initializeApp instead of a stub, which causes heartbeatService to also be initialized and start running its lifecycle methods.

The solution is to replace the heartbeatService component in the app used for testing, a fix which was already done in AppCheck, probably for the same problem https://github.com/firebase/firebase-js-sdk/blob/main/packages/app-check/test/util.ts#L70 Analytics tests don't need to test the heartbeatService so it makes sense to stub it out.

Copy link

changeset-bot bot commented Oct 1, 2024

⚠️ No Changeset found

Latest commit: 0a03d42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hsubox76 hsubox76 marked this pull request as ready for review October 1, 2024 18:40
@hsubox76 hsubox76 requested a review from a team as a code owner October 1, 2024 18:40
@google-oss-bot
Copy link
Contributor

@google-oss-bot
Copy link
Contributor

@hsubox76 hsubox76 merged commit f3b8e4c into main Oct 2, 2024
35 checks passed
@hsubox76 hsubox76 deleted the ch-analytics-test-fix branch October 2, 2024 16:41
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.

3 participants