2

I am trying to combine Angular, Jest and Apollo.

My Spec file follows the structure described in the documentation here.

When I run only jest like this: jest --watchAll everything works. But if I like this: jest --watchAll --collectCoverage, all spec files with the apollo testing module fails with:

TypeError: Cannot read property 'use' of undefined
      58 |   ) {
    > 59 |     this.numberOfDrafts$ = this.getNumberOfDraftsGQL.watch().valueChanges.pipe(
         |                                                      ^

(line 59 is inside a components constructor).

I hope someone can help me understand what this error message means, and why it appears only if I collect coverage?

skyboyer
  • 22,209
  • 7
  • 57
  • 64
DauleDK
  • 3,313
  • 11
  • 55
  • 98

0 Answers0