-
Notifications
You must be signed in to change notification settings - Fork 992
fix(firestore): use Firestore instead of FirebaseFirestore in error messages #9435
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -514,7 +514,7 @@ export function collection<AppModelType, DbModelType extends DocumentData>( | |
| throw new FirestoreError( | ||
| Code.INVALID_ARGUMENT, | ||
| 'Expected first argument to collection() to be a CollectionReference, ' + | ||
| 'a DocumentReference or FirebaseFirestore' | ||
| 'a DocumentReference or Firestore' | ||
| ); | ||
| } | ||
| const absolutePath = parent._path.child( | ||
|
|
@@ -652,7 +652,7 @@ export function doc<AppModelType, DbModelType extends DocumentData>( | |
| throw new FirestoreError( | ||
| Code.INVALID_ARGUMENT, | ||
| 'Expected first argument to doc() to be a CollectionReference, ' + | ||
| 'a DocumentReference or FirebaseFirestore' | ||
| 'a DocumentReference or Firestore' | ||
|
Comment on lines
654
to
+655
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error message change is correct. However, it looks like the corresponding unit test in |
||
| ); | ||
| } | ||
| const absolutePath = parent._path.child( | ||
|
|
||
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.
While updating this error message, it would be a good opportunity to add a test case to
packages/firestore/test/lite/integration.test.tsthat validates this specific error for thecollection()function. This would improve test coverage and ensure this error message is validated, similar to the existing test fordoc().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.
Thanks for the suggestion! I’ve updated the existing doc() test to expect
Firestoreand added a corresponding test for collection() to improvecoverage. Please let me know if this looks good.