How do I create DocumentSnapshots for Firebase Firestore for testing purposes?

Viewed 772

I am writing an iOS app in swift and I need to test my promise chain. Part of the logic in the app depends on if Firestore returns a valid DocumentSnapshot from a call. If valid doc then go to main screen, else create new user flow.

I can't instantiate a DocumentSnapshot directly or inherit and override it, what else can I do? As a last resort I could just dependency inject something in its place for test but I thought to ask here first.

Anyway I can instantiate a DocumentSnapshot object myself?

1 Answers
Related