Repository navigation
docs: add a unit testing guide - #3855
Merged
Merged
Conversation
AngularFire had no testing guidance in docs/ or the README, and four issues have asked for it. docs/testing.md covers Vitest and Jest: real services built from made-up options, three ways to replace AngularFire in a test, the setups that do not work with their error text, and the resolver file Jest 30 needs. The README links to it. Fixes angular#3668
The hook deletes every Firebase app after each test, including one created with AngularFireModule.initializeApp. The next test that calls AngularFireModule.initializeApp then fails with "already deleted", even with the same options. Measured under Jest and Vitest.
tyler-reitz
approved these changes
Dec 1, 2026
This file contains hidden or 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
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.
Checklist
yarn install,yarn testrun successfully? not run (Markdown only)Description
AngularFire has no testing guidance in
docs/or the README, and #3668 asks for a documented way to unit test code that uses it. This addsdocs/testing.mdand links it from the README's resource list.The page covers Vitest, which
ng newsets up, and Jest.How I checked it
I pasted every snippet unchanged into apps created with
ng newand ran them:Then I removed each instruction in turn and confirmed the failure the page describes. Instructions whose removal changed nothing are not on the page.
A Karma and Jasmine section will follow in its own pull request.
Fixes #3668