From 4dc2a9c08eafbdd397c2777dc9297aab18e1f85d Mon Sep 17 00:00:00 2001 From: David East Date: Tue, 11 Jul 2023 19:40:24 +0000 Subject: [PATCH] lint fixes --- firestore/collection/index.ts | 4 ++-- firestore/lite/collection/index.ts | 2 +- test/firestore-lite.test.ts | 37 +++++++++++++----------------- test/firestore.test.ts | 32 +++++++++++--------------- 4 files changed, 33 insertions(+), 42 deletions(-) diff --git a/firestore/collection/index.ts b/firestore/collection/index.ts index bb267b5..e0b7723 100644 --- a/firestore/collection/index.ts +++ b/firestore/collection/index.ts @@ -35,7 +35,7 @@ import { import {snapToData} from '../document'; import {DocumentChangeType, DocumentChange, Query, QueryDocumentSnapshot, QuerySnapshot, DocumentData} from '../interfaces'; import {getCountFromServer, refEqual} from 'firebase/firestore'; -import { CountSnapshot } from '../lite/interfaces'; +import {CountSnapshot} from '../lite/interfaces'; const ALL_EVENTS: DocumentChangeType[] = ['added', 'modified', 'removed']; /** @@ -303,5 +303,5 @@ export function collectionCountSnap$(query: Query): Observable): Observable { - return collectionCountSnap$(query).pipe(map(snap => snap.data().count)); + return collectionCountSnap$(query).pipe(map((snap) => snap.data().count)); } diff --git a/firestore/lite/collection/index.ts b/firestore/lite/collection/index.ts index cc70ae0..5e107a1 100644 --- a/firestore/lite/collection/index.ts +++ b/firestore/lite/collection/index.ts @@ -53,5 +53,5 @@ export function collectionCountSnap$(query: Query): Observable): Observable { - return collectionCountSnap$(query).pipe(map(snap => snap.data().count)); + return collectionCountSnap$(query).pipe(map((snap) => snap.data().count)); } diff --git a/test/firestore-lite.test.ts b/test/firestore-lite.test.ts index 78039dc..51e58b2 100644 --- a/test/firestore-lite.test.ts +++ b/test/firestore-lite.test.ts @@ -84,8 +84,8 @@ describe('RxFire firestore/lite', () => { afterEach((done) => { deleteApp(app) - .then(() => done()) - .catch(() => undefined); + .then(() => done()) + .catch(() => undefined); }); describe('collection', () => { @@ -227,40 +227,35 @@ describe('RxFire firestore/lite', () => { }); describe('Aggregations', () => { - it('should provide an observable with a count aggregate', async (done) => { const colRef = createRandomCol(firestore); const entries = [ - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), ]; - await Promise.all(entries) - - collectionCountSnap$(colRef).subscribe(snap => { + await Promise.all(entries); + + collectionCountSnap$(colRef).subscribe((snap) => { expect(snap.data().count).toEqual(entries.length); done(); }); - }); it('should provide an observable with a count aggregate number', async (done) => { const colRef = createRandomCol(firestore); const entries = [ - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), ]; - await Promise.all(entries) - - collectionCount$(colRef).subscribe(count => { + await Promise.all(entries); + + collectionCount$(colRef).subscribe((count) => { expect(count).toEqual(entries.length); done(); }); - }); - - }) - + }); }); diff --git a/test/firestore.test.ts b/test/firestore.test.ts index 76d6039..d9ef834 100644 --- a/test/firestore.test.ts +++ b/test/firestore.test.ts @@ -426,39 +426,35 @@ describe('RxFire Firestore', () => { }); describe('Aggregations', () => { - it('should provide an observable with a count aggregate snapshot', async (done) => { const colRef = createRandomCol(firestore); const entries = [ - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), ]; - await Promise.all(entries) - - collectionCountSnap$(colRef).subscribe(snap => { + await Promise.all(entries); + + collectionCountSnap$(colRef).subscribe((snap) => { expect(snap.data().count).toEqual(entries.length); done(); }); - }); it('should provide an observable with a count aggregate number', async (done) => { const colRef = createRandomCol(firestore); const entries = [ - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), - addDoc(colRef, { id: createId() }), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), + addDoc(colRef, {id: createId()}), ]; - await Promise.all(entries) - - collectionCount$(colRef).subscribe(count => { + await Promise.all(entries); + + collectionCount$(colRef).subscribe((count) => { expect(count).toEqual(entries.length); done(); }); - }); - - }) + }); });