firestore-jest-mock icon indicating copy to clipboard operation
firestore-jest-mock copied to clipboard

Mock Errors

Open otherguy opened this issue 1 year ago • 0 comments
trafficstars

First of all, thank you for this amazing project!

I haven't yet found a way to mock issues/errors with Firestore. Is it possible to do something like this?

mockCollection.mockImplementationOnce(() => {
  throw new Error("Firestore is down");
});

I'm not testing Firestore directly, but I'm using supertest to test how my API handles Firestore errors.

otherguy avatar Sep 27 '24 11:09 otherguy