Skip to content

Commit 039f05f

Browse files
authored
Firestore: remove explicit type from persistence argument in integration tests (#7405)
1 parent 35c35fe commit 039f05f

19 files changed

+1250
-1261
lines changed

packages/firestore/test/integration/api/aggregation.test.ts

+1,078-1,086
Large diffs are not rendered by default.

packages/firestore/test/integration/api/array_transforms.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ addEqualityMatcher();
4242
* together, etc.) and so these tests mostly focus on the array transform
4343
* semantics.
4444
*/
45-
apiDescribe('Array Transforms:', (persistence: boolean) => {
45+
apiDescribe('Array Transforms:', persistence => {
4646
// A document reference to read and write to.
4747
let docRef: DocumentReference;
4848

packages/firestore/test/integration/api/batch_writes.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
withTestDoc
4242
} from '../util/helpers';
4343

44-
apiDescribe('Database batch writes', (persistence: boolean) => {
44+
apiDescribe('Database batch writes', persistence => {
4545
it('supports empty batches', () => {
4646
return withTestDb(persistence, db => {
4747
return writeBatch(db).commit();
@@ -329,7 +329,7 @@ apiDescribe('Database batch writes', (persistence: boolean) => {
329329

330330
// PORTING NOTE: These tests are for FirestoreDataConverter support and apply
331331
// only to web.
332-
apiDescribe('withConverter() support', (persistence: boolean) => {
332+
apiDescribe('withConverter() support', persistence => {
333333
class Post {
334334
constructor(readonly title: string, readonly author: string) {}
335335
byline(): string {

packages/firestore/test/integration/api/bundle.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const BUNDLE_TEMPLATE = [
6969
'{"document":{"name":"projects/{0}/databases/(default)/documents/coll-1/b","createTime":{"seconds":1,"nanos":9},"updateTime":{"seconds":1,"nanos":9},"fields":{"k":{"stringValue":"b"},"bar":{"integerValue":2}}}}'
7070
];
7171

72-
apiDescribe('Bundles', (persistence: boolean) => {
72+
apiDescribe('Bundles', persistence => {
7373
function verifySnapEqualsTestDocs(snap: QuerySnapshot): void {
7474
expect(toDataArray(snap)).to.deep.equal([
7575
{ k: 'a', bar: 1 },

packages/firestore/test/integration/api/cursor.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
withTestDbs
4545
} from '../util/helpers';
4646

47-
apiDescribe('Cursors', (persistence: boolean) => {
47+
apiDescribe('Cursors', persistence => {
4848
it('can page through items', () => {
4949
const testDocs = {
5050
a: { v: 'a' },

packages/firestore/test/integration/api/database.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { DEFAULT_SETTINGS, DEFAULT_PROJECT_ID } from '../util/settings';
8181

8282
use(chaiAsPromised);
8383

84-
apiDescribe('Database', (persistence: boolean) => {
84+
apiDescribe('Database', persistence => {
8585
it('can set a document', () => {
8686
return withTestDoc(persistence, docRef => {
8787
return setDoc(docRef, {
@@ -638,7 +638,7 @@ apiDescribe('Database', (persistence: boolean) => {
638638
});
639639
});
640640

641-
apiDescribe('Queries are validated client-side', (persistence: boolean) => {
641+
apiDescribe('Queries are validated client-side', persistence => {
642642
// NOTE: Failure cases are validated in validation_test.ts
643643

644644
it('same inequality fields works', () => {
@@ -1340,7 +1340,7 @@ apiDescribe('Database', (persistence: boolean) => {
13401340

13411341
// PORTING NOTE: These tests are for FirestoreDataConverter support and apply
13421342
// only to web.
1343-
apiDescribe('withConverter() support', (persistence: boolean) => {
1343+
apiDescribe('withConverter() support', persistence => {
13441344
class Post {
13451345
constructor(
13461346
readonly title: string,

packages/firestore/test/integration/api/fields.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { DEFAULT_SETTINGS } from '../util/settings';
4343
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4444
type AnyTestData = any;
4545

46-
apiDescribe('Nested Fields', (persistence: boolean) => {
46+
apiDescribe('Nested Fields', persistence => {
4747
const testData = (n?: number): AnyTestData => {
4848
n = n || 1;
4949
return {
@@ -240,7 +240,7 @@ apiDescribe('Nested Fields', (persistence: boolean) => {
240240
// NOTE(mikelehen): I originally combined these tests with the above ones, but
241241
// Datastore currently prohibits having nested fields and fields with dots in
242242
// the same entity, so I'm separating them.
243-
apiDescribe('Fields with special characters', (persistence: boolean) => {
243+
apiDescribe('Fields with special characters', persistence => {
244244
const testData = (n?: number): AnyTestData => {
245245
n = n || 1;
246246
return {
@@ -340,7 +340,7 @@ apiDescribe('Fields with special characters', (persistence: boolean) => {
340340
});
341341
});
342342

343-
apiDescribe('Timestamp Fields in snapshots', (persistence: boolean) => {
343+
apiDescribe('Timestamp Fields in snapshots', persistence => {
344344
// Figure out how to pass in the Timestamp type
345345
// eslint-disable-next-line @typescript-eslint/no-explicit-any
346346
const testDataWithTimestamps = (ts: any): AnyTestData => {
@@ -379,7 +379,7 @@ apiDescribe('Timestamp Fields in snapshots', (persistence: boolean) => {
379379
});
380380
});
381381

382-
apiDescribe('`undefined` properties', (persistence: boolean) => {
382+
apiDescribe('`undefined` properties', persistence => {
383383
const settings = { ...DEFAULT_SETTINGS };
384384
settings.ignoreUndefinedProperties = true;
385385

packages/firestore/test/integration/api/get_options.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
withEnsuredLruGcTestDb
4040
} from '../util/helpers';
4141

42-
apiDescribe('GetOptions', (persistence: boolean) => {
42+
apiDescribe('GetOptions', persistence => {
4343
it('get document while online with default get options', () => {
4444
const initialData = { key: 'value' };
4545
return withTestDocAndInitialData(persistence, initialData, docRef => {

packages/firestore/test/integration/api/index_configuration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { expect } from 'chai';
2020
import { setIndexConfiguration } from '../util/firebase_export';
2121
import { apiDescribe, withTestDb } from '../util/helpers';
2222

23-
apiDescribe('Index Configuration:', (persistence: boolean) => {
23+
apiDescribe('Index Configuration:', persistence => {
2424
it('supports JSON', () => {
2525
return withTestDb(persistence, async db => {
2626
return setIndexConfiguration(

packages/firestore/test/integration/api/numeric_transforms.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { apiDescribe, withTestDoc } from '../util/helpers';
3737

3838
const DOUBLE_EPSILON = 0.000001;
3939

40-
apiDescribe('Numeric Transforms:', (persistence: boolean) => {
40+
apiDescribe('Numeric Transforms:', persistence => {
4141
// A document reference to read and write to.
4242
let docRef: DocumentReference;
4343

packages/firestore/test/integration/api/query.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import {
7070
import { USE_EMULATOR } from '../util/settings';
7171
import { captureExistenceFilterMismatches } from '../util/testing_hooks_util';
7272

73-
apiDescribe('Queries', (persistence: boolean) => {
73+
apiDescribe('Queries', persistence => {
7474
addEqualityMatcher();
7575

7676
it('can issue limit queries', () => {

packages/firestore/test/integration/api/server_timestamp.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { apiDescribe, withTestDoc } from '../util/helpers';
3838
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3939
type AnyTestData = any;
4040

41-
apiDescribe('Server Timestamps', (persistence: boolean) => {
41+
apiDescribe('Server Timestamps', persistence => {
4242
// Data written in tests via set().
4343
const setData = {
4444
a: 42,

packages/firestore/test/integration/api/smoke.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
withTestDoc
4141
} from '../util/helpers';
4242

43-
apiDescribe('Smoke Test', (persistence: boolean) => {
43+
apiDescribe('Smoke Test', persistence => {
4444
it('can write a single document', () => {
4545
return withTestDoc(persistence, ref => {
4646
return setDoc(ref, {

packages/firestore/test/integration/api/transactions.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
} from '../util/firebase_export';
3636
import { apiDescribe, withTestDb } from '../util/helpers';
3737

38-
apiDescribe('Database transactions', (persistence: boolean) => {
38+
apiDescribe('Database transactions', persistence => {
3939
type TransactionStage = (
4040
transaction: Transaction,
4141
docRef: DocumentReference
@@ -704,7 +704,7 @@ apiDescribe('Database transactions', (persistence: boolean) => {
704704

705705
// PORTING NOTE: These tests are for FirestoreDataConverter support and apply
706706
// only to web.
707-
apiDescribe('withConverter() support', (persistence: boolean) => {
707+
apiDescribe('withConverter() support', persistence => {
708708
class Post {
709709
constructor(readonly title: string, readonly author: string) {}
710710
byline(): string {

packages/firestore/test/integration/api/type.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
} from '../util/firebase_export';
3838
import { apiDescribe, withTestDb, withTestDoc } from '../util/helpers';
3939

40-
apiDescribe('Firestore', (persistence: boolean) => {
40+
apiDescribe('Firestore', persistence => {
4141
addEqualityMatcher();
4242

4343
async function expectRoundtrip(

packages/firestore/test/integration/api/validation.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class TestClass {
132132
constructor(readonly property: string) {}
133133
}
134134

135-
apiDescribe('Validation:', (persistence: boolean) => {
135+
apiDescribe('Validation:', persistence => {
136136
describe('FirestoreSettings', () => {
137137
// Enabling persistence counts as a use of the firestore instance, meaning
138138
// that it will be impossible to verify that a set of settings don't throw,

packages/firestore/test/integration/api_internal/database.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { withMockCredentialProviderTestDb } from '../util/internal_helpers';
3333

3434
use(chaiAsPromised);
3535

36-
apiDescribe('Database (with internal API)', (persistence: boolean) => {
36+
apiDescribe('Database (with internal API)', persistence => {
3737
// eslint-disable-next-line no-restricted-properties
3838
(persistence ? it : it.skip)(
3939
'will reject the promise if clear persistence fails',

packages/firestore/test/integration/api_internal/idle_timeout.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { collection, doc, onSnapshot, setDoc } from '../util/firebase_export';
2121
import { apiDescribe, withTestDb } from '../util/helpers';
2222
import { asyncQueue } from '../util/internal_helpers';
2323

24-
apiDescribe('Idle Timeout', (persistence: boolean) => {
24+
apiDescribe('Idle Timeout', persistence => {
2525
it('can write document after idle timeout', () => {
2626
return withTestDb(persistence, db => {
2727
const docRef = doc(collection(db, 'test-collection'));

0 commit comments

Comments
 (0)