Skip to content

makeDocumentSnapshot: TypeError: firestoreService.snapshot_ is not a function #87

@tettoffensive

Description

@tettoffensive

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',
    );
...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions