Skip to content

Update Lite tests with Query API v2 #3446

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

Merged
merged 19 commits into from
Jul 23, 2020
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Jul 21, 2020

  • Adds the Lite test to CI
  • Fixes the Lite tests after the Query API changes
  • Adds "converter" to Query and DocumentSnapshot API so TypeScript can deduce type of generic (without it all Queries return QuerySnapshot). I will add this to the API review right away.
  • Fixes the IntelliJ test runner for firestore-exp and adds one for the Lite SDK.

@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2020

💥 No Changeset

Latest commit: addcda1

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, 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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 21, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore/exp

    Type Base (9788c43) Head (e78128a) Diff
    browser 187 kB 187 kB +89 B (+0.0%)
    main 511 kB 511 kB -40 B (-0.0%)
    react-native 187 kB 188 kB +89 B (+0.0%)
  • @firebase/firestore/lite

    Type Base (9788c43) Head (e78128a) Diff
    browser 68.0 kB 68.0 kB +68 B (+0.1%)
    main 497 kB 497 kB -49 B (-0.0%)
    react-native 68.0 kB 68.1 kB +68 B (+0.1%)

Test Logs

@@ -68,7 +68,7 @@ export interface FirestoreDataConverter<T> {
toFirestore(modelObject: Partial<T>, options: SetOptions): DocumentData;
fromFirestore(
snapshot: QueryDocumentSnapshot<DocumentData>,
options: SnapshotOptions
options?: SnapshotOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to make this interface compatible with the FirestoreDataConverter in lite.

@@ -177,7 +186,7 @@ describe('doc', () => {
'Function doc() requires its second argument to be of type non-empty string, but it was: ""'
);
expect(() => doc(collection(db, 'coll'), 'doc/coll')).to.throw(
'Invalid document path (coll/doc/coll). Path points to a collection.'
'Invalid document reference. Document references must have an even number of segments, but coll/doc/coll has 3.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: line too long.

@@ -233,7 +242,7 @@ describe('collection', () => {
'Function collection() requires its second argument to be of type non-empty string, but it was: ""'
);
expect(() => collection(doc(db, 'coll/doc'), 'coll/doc')).to.throw(
'Invalid collection path (coll/doc/coll/doc). Path points to a document.'
'Invalid collection reference. Collection references must have an odd number of segments, but coll/doc/coll/doc has 4.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: line too long.

@schmidt-sebastian schmidt-sebastian merged commit 7913ae9 into master Jul 23, 2020
@firebase firebase locked and limited conversation to collaborators Aug 23, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/fixlitetests branch November 9, 2020 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants