0

I am unit testing my angular apollo app. I always get the same error:

Error: Expected one matching operation for criteria "Match DocumentNode", found none.
            at ApolloTestingBackend.expectOne (node_modules/apollo-angular/fesm2020/ngApolloTesting.mjs:135:19)
            at UserContext.apply (src/app/my-service.service.spec.ts:66:35)
            at _ZoneDelegate.invoke (node_modules/zone.js/fesm2015/zone.js:372:26)
            at ProxyZoneSpec.onInvoke (node_modules/zone.js/fesm2015/zone-testing.js:287:39)
            at _ZoneDelegate.invoke (node_modules/zone.js/fesm2015/zone.js:371:52)
            at Zone.run (node_modules/zone.js/fesm2015/zone.js:134:43)
            at runInTestZone (node_modules/zone.js/fesm2015/zone-testing.js:582:34)
            at UserContext.<anonymous> (node_modules/zone.js/fesm2015/zone-testing.js:597:20)
            at <Jasmine>
Chrome 103.0.5060.53 (Linux x86_64): Executed 1 of 1 (1 FAILED) (0.108 secs / 0.092 secs)

This error occurs on the line:

const op = apolloController.expectOne(QUERY_GQL);

I have already reviewed all the related posts and none of them solve the problem. Someone could help me?

I am waiting for a response from someone who can solve my problem. Thank you very much.

Greetings.

Esther_5
  • 151
  • 2
  • 10

0 Answers0