-
Notifications
You must be signed in to change notification settings - Fork 942
Fix Integration tests against 'minified' sources #2445
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
@@ -159,7 +158,7 @@ apiDescribe('Validation:', (persistence: boolean) => { | |||
|
|||
validationIt(persistence, 'garbage collection can be disabled', db => { | |||
// Verify that this doesn't throw. | |||
db.settings({ cacheSizeBytes: CACHE_SIZE_UNLIMITED }); | |||
db.settings({ cacheSizeBytes: /* CACHE_SIZE_UNLIMITED */ -1 }); |
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.
The constant is not exported internally (https://github.com/firebase/firebase-js-sdk/blob/ae319059e4a083a613a2999c1e61d44c9053a0d7/packages/firestore/index.ts)
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.
Does that mean our types / docs are a lie?
firebase-js-sdk/packages/firebase/index.d.ts
Line 6986 in 6480d7f
export const CACHE_SIZE_UNLIMITED: number; |
If so, can you open a bug?
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.
I was able to make it work by importing it from the namespace: firestore.CACHE_SIZE_UNLIMITED
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.
Niiice! Couple nits, but looks good. Please consider getting this added to travis once we get minification going...
() => fail('Expected cache miss'), | ||
err => expect(err.code).to.be.equal(Code.UNAVAILABLE) | ||
() => { | ||
throw new Error('Expected cache miss'); |
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.
I think you can use expect.fail(...)
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 here and in the rest of the file.
} | ||
); | ||
return deferred.promise; | ||
return withTestCollection(persistence, {}, queryForRejection => { |
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.
Eh... I think the old (disabled) code was barely discernible and the new disabled code crosses the line into indiscernible territory.
I think it might be better to change the original line to:
const queryForRejection = null as Query;
And then the TODO makes it barely discernible again that queryForRejection is supposed to be a query that will be rejected.
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.
Done. I wonder though if we could just use a query that requires a non-existing index.
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.
Oh! That's a good thought.
@@ -159,7 +158,7 @@ apiDescribe('Validation:', (persistence: boolean) => { | |||
|
|||
validationIt(persistence, 'garbage collection can be disabled', db => { | |||
// Verify that this doesn't throw. | |||
db.settings({ cacheSizeBytes: CACHE_SIZE_UNLIMITED }); | |||
db.settings({ cacheSizeBytes: /* CACHE_SIZE_UNLIMITED */ -1 }); |
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.
Does that mean our types / docs are a lie?
firebase-js-sdk/packages/firebase/index.d.ts
Line 6986 in 6480d7f
export const CACHE_SIZE_UNLIMITED: number; |
If so, can you open a bug?
This PR fixes
npm run test:manual
in 'integration/firestore'.It moves all tests that require Internal API to the respective "api_internal" tests. It also does the same for the helpers. For the timestampsInSnapshot tests, it unfortunately re-adds the logging to the console output (running a test that verifies that we don't minify our settings is probably a good enough justification).
Two follow up PRs for this: