-
Notifications
You must be signed in to change notification settings - Fork 927
Port Compat tests to v9 API #5844
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
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (322,844 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 |
a795f0a
to
44b61ee
Compare
0d0aba4
to
0a53721
Compare
0a53721
to
a4ce6f9
Compare
9a4d175
to
c80fab0
Compare
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.
13 / 45 files reviewed so far...
} else { | ||
process.env.INCLUDE_FIRESTORE_PERSISTENCE = '${isPersistenceEnabled()}'; | ||
}` | ||
if (typeof process === 'undefined') { |
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.
is this indentation change intentional?
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.
Yeah, the output looks much better. This is a search/replace thing and the output shouldn't be indented. It doesn't really matter though since no one should see this, but I like to go above and beyond :)
{ includeMetadataChanges: true }, | ||
accumulator.storeEvent | ||
); | ||
|
||
// wait for initial null snapshot to avoid potential races. | ||
const snapshot = await accumulator.awaitRemoteEvent(); | ||
expect(snapshot.exists).to.be.false; | ||
expect(snapshot.exists()).to.be.false; |
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.
Ouch. Nothing about this PR, but this is such an easy thing to miss. @cherylEnkidu spent a lot of time debugging her code as she had used snapshot.exists
while using v9 :-)
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.
TAT People use exists in v8 but exists() in v9
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.
We changed it to a method so we could use a typeguard:
exists(): this is QueryDocumentSnapshot<T>;
If exists() returns true
then TS knows .data
is not undefined.
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.
25 / 45 ...
import { apiDescribe, withTestDb } from '../util/helpers'; | ||
import { asyncQueue } from '../util/internal_helpers'; | ||
|
||
apiDescribe('Idle Timeout', (persistence: boolean) => { | ||
it('can write document after idle timeout', () => { | ||
it('can write documdent after idle timeout', () => { |
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.
typo
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.
Fixed
We currently use the Compat API to test v9. This works because every API in v9 is also available in Compat. As we are adding new APIs, this will stop working though. This PR migrates both the Firestore integration tests and the minified tests to use the v9 API.
There is another PR pending that re-adds the Compat tests: #5870