Closed sbatson5 closed 3 years ago
Adds the ability to pass options to the mock, allowing you to include id's in your document's data.
Fixes: https://github.com/Upstatement/firestore-jest-mock/issues/68
Also adds the ability for future options, which I think can be a good stop-gap for https://github.com/Upstatement/firestore-jest-mock/pull/70
Pass a second param to mockFirebase as your "options." You can set includeIdsInData to have doc.data() return the id of the document (custom behavior).
mockFirebase
includeIdsInData
doc.data()
Description
Adds the ability to pass options to the mock, allowing you to include id's in your document's data.
Related issues
Fixes: https://github.com/Upstatement/firestore-jest-mock/issues/68
Also adds the ability for future options, which I think can be a good stop-gap for https://github.com/Upstatement/firestore-jest-mock/pull/70
How to test
Pass a second param to
mockFirebase
as your "options." You can setincludeIdsInData
to havedoc.data()
return the id of the document (custom behavior).