Skip to content

Commit 8e1e51a

Browse files
committed
Remove tests on client side. Lint / format.
1 parent df70734 commit 8e1e51a

File tree

8 files changed

+366
-447
lines changed

8 files changed

+366
-447
lines changed

packages/firestore/src/api/snapshot.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import {
4949
} from '../platform/snapshot_to_json';
5050
import { fromDocument } from '../remote/serializer';
5151
import { debugAssert, fail } from '../util/assert';
52-
5352
import { Code, FirestoreError } from '../util/error';
5453
// API extractor fails importing 'property' unless we also explicitly import 'Property'.
5554
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts

packages/firestore/src/platform/browser/snapshot_to_json.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@
1616
*/
1717

1818
/** Return the Platform-specific build JSON bundle implementations. */
19+
import { Firestore } from '../../api/database';
1920
import { Query } from '../../core/query';
2021
import { DocumentData } from '../../lite-api/reference';
2122
import { Document } from '../../model/document';
22-
import { Firestore } from '../../api/database';
23-
2423

2524
export function buildDocumentSnapshotJsonBundle(
2625
db: Firestore,
2726
document: Document,
2827
docData: DocumentData,
2928
path: string
3029
): string {
31-
return "NOT SUPPORTED";
30+
return 'NOT SUPPORTED';
3231
}
3332

3433
export function buildQuerySnapshotJsonBundle(
@@ -39,6 +38,6 @@ export function buildQuerySnapshotJsonBundle(
3938
paths: string[],
4039
docs: Document[],
4140
documentData: DocumentData[]
42-
) : string {
43-
return "NOT SUPPORTED";
41+
): string {
42+
return 'NOT SUPPORTED';
4443
}

packages/firestore/src/platform/node/snapshot_to_json.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
/** Return the Platform-specific build JSON bundle implementations. */
1919
import { Firestore } from '../../api/database';
2020
import { Query } from '../../core/query';
21-
import {
22-
DocumentData
23-
} from '../../lite-api/reference';
21+
import { DocumentData } from '../../lite-api/reference';
2422
import { Document } from '../../model/document';
2523
import {
2624
BundleBuilder,
@@ -29,22 +27,16 @@ import {
2927
} from '../../util/bundle_builder_impl';
3028
import { AutoId } from '../../util/misc';
3129

32-
3330
export function buildDocumentSnapshotJsonBundle(
3431
db: Firestore,
3532
document: Document,
3633
docData: DocumentData,
3734
path: string
3835
): string {
39-
const builder: BundleBuilder = new BundleBuilder(
40-
db,
41-
AutoId.newId()
36+
const builder: BundleBuilder = new BundleBuilder(db, AutoId.newId());
37+
builder.addBundleDocument(
38+
documentToDocumentSnapshotBundleData(path, docData, document)
4239
);
43-
builder.addBundleDocument(documentToDocumentSnapshotBundleData(
44-
path,
45-
docData,
46-
document
47-
));
4840
return builder.build();
4941
}
5042

@@ -56,15 +48,11 @@ export function buildQuerySnapshotJsonBundle(
5648
paths: string[],
5749
docs: Document[],
5850
documentData: DocumentData[]
59-
) : string {
51+
): string {
6052
const docBundleDataArray: DocumentSnapshotBundleData[] = [];
6153
for (let i = 0; i < docs.length; i++) {
6254
docBundleDataArray.push(
63-
documentToDocumentSnapshotBundleData(
64-
paths[i],
65-
documentData[i],
66-
docs[i]
67-
)
55+
documentToDocumentSnapshotBundleData(paths[i], documentData[i], docs[i])
6856
);
6957
}
7058
const bundleData: QuerySnapshotBundleData = {

packages/firestore/src/platform/snapshot_to_json.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
* limitations under the License.
1616
*/
1717

18+
import { Firestore } from '../api/database';
1819
import { Query } from '../core/query';
1920
import { DocumentData } from '../lite-api/reference';
2021
import { Document } from '../model/document';
21-
import { Firestore } from '../api/database';
2222

2323
// This file is only used under ts-node.
2424
// eslint-disable-next-line @typescript-eslint/no-require-imports
25-
const platform = require(`./${process.env.TEST_PLATFORM ?? 'node'}/snapshot_to_json`);
25+
const platform = require(`./${
26+
process.env.TEST_PLATFORM ?? 'node'
27+
}/snapshot_to_json`);
2628

27-
/**
29+
/**
2830
* Constructs the bundle data for a DocumentSnapshot used in its toJSON serialization.
2931
*/
3032
export function buildDocumentSnapshotJsonBundle(
@@ -36,16 +38,25 @@ export function buildDocumentSnapshotJsonBundle(
3638
return platform.buildDocumentSnapshotJsonBundle(db, document, docData, path);
3739
}
3840

39-
/**
41+
/**
4042
* Constructs the bundle data for a QuerySnapshot used in its toJSON serialization.
4143
*/
4244
export function buildQuerySnapshotJsonBundle(
43-
db: Firestore, query: Query,
45+
db: Firestore,
46+
query: Query,
4447
bundleName: string,
4548
parent: string,
4649
paths: string[],
4750
docs: Document[],
4851
documentData: DocumentData[]
49-
) : string {
50-
return platform.buildQuerySnapshotJsonBundle(db, query, bundleName, parent, paths, docs, documentData);
51-
}
52+
): string {
53+
return platform.buildQuerySnapshotJsonBundle(
54+
db,
55+
query,
56+
bundleName,
57+
parent,
58+
paths,
59+
docs,
60+
documentData
61+
);
62+
}

0 commit comments

Comments
 (0)