I get the following error when trying to use makeDocumentSnapshot: TypeError: firestoreService.snapshot_ is not a function
It seems that it has to do with the following line:
|
return firestoreService.snapshot_(proto, readTimeProto, 'json'); |
My code is as follows:
import FunctionsTest from 'firebase-functions-test';
import onUserWritten from '../onUserWritten.function';
const test = FunctionsTest();
describe('onUserWritten', () => {
it('should do stuff', async () => {
const wrapped = test.wrap(onUserWritten);
const beforeSnap = test.firestore.makeDocumentSnapshot(
{
id: 'testUser',
email: '[email protected]',
},
'/users/testUser',
);
...
I get the following error when trying to use
makeDocumentSnapshot:TypeError: firestoreService.snapshot_ is not a functionIt seems that it has to do with the following line:
firebase-functions-test/src/providers/firestore.ts
Line 83 in 2574781
My code is as follows: