firestore-vitest
Version:
Vitest helper for mocking Google Cloud Firestore
21 lines (17 loc) • 774 B
TypeScript
import type { StubOverrides, StubOptions } from './firebase.js';
import type { FakeFirestore } from './firestore.js';
declare class Firestore extends FakeFirestore {
constructor();
}
interface GCloudFirestoreMock {
Firestore: typeof Firestore;
Query: typeof Firestore.Query;
CollectionReference: typeof Firestore.CollectionReference;
DocumentReference: typeof Firestore.DocumentReference;
FieldValue: typeof Firestore.FieldValue;
FieldPath: typeof Firestore.FieldPath;
Timestamp: typeof Firestore.Timestamp;
Transaction: typeof Firestore.Transaction;
}
export const firestoreStub: (overrides: StubOverrides, options?: StubOptions) => GCloudFirestoreMock;
export const mockGoogleCloudFirestore: (overrides: StubOverrides, options?: StubOptions) => void;