Skip to content

Commit

Permalink
Add mockRecursiveDelete type def, missing create def from FirestoreBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
netdown authored Jan 26, 2024
1 parent 9a8cae1 commit 09491c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mocks/firestore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface FirestoreBatch {
delete(): FirestoreBatch;
set(doc: DocumentReference, data: DocumentData, options?: SetOptions): FirestoreBatch;
update(doc: DocumentReference, data: DocumentData): FirestoreBatch;
create(doc: DocumentReference, data: DocumentData): FirestoreBatch;
commit(): Promise<void>;
}

Expand Down Expand Up @@ -54,6 +55,7 @@ export class FakeFirestore {
collectionGroup(collectionName: string): Query;
doc(path: string): DocumentReference;
runTransaction<T>(updateFunction: (transaction: Transaction) => Promise<T>): Promise<T>;
recursiveDelete(ref: DocumentReference|CollectionReference): Promise<void>;
}

declare class DocumentReference {
Expand Down Expand Up @@ -118,6 +120,7 @@ declare class CollectionReference extends FakeFirestore.Query {
// Mocks exported from this module
export const mockBatch: jest.Mock;
export const mockRunTransaction: jest.Mock;
export const mockRecursiveDelete: jest.Mock;

export const mockCollection: jest.Mock;
export const mockCollectionGroup: jest.Mock;
Expand Down

0 comments on commit 09491c1

Please sign in to comment.