Minimum Reproducible Repo =
https://github.com/david-kirkland/ng18-code-coverage
I have started from scratch several times and cannot seem to get e2e test coverage using Angular 18
, cypress
, @cypress/code-coverage
, @cypress/schematic
, nyc
(aka: Istanbul), etc.
It does seem to be instrumenting the code because I get data in .nyc_output/
as a dynamically generated file…
…but the data never moves to .nyc_output/out.json
…
I’m guessing this is what @cypress/code-coverage
is using because the reports are empty…
Cypress also throws an error saying Did you forget to instrument your application?
…
I have read all the documentation I can find and followed all the guides trying various techniques. I have yet to find a working example for Cypress e2e testing code coverage with Angular 18. Are they even compatible?
2
I finally got e2e code coverage working.
https://github.com/david-kirkland/ng18-code-coverage/tree/e2e-code-coverage-working
Pull this branch and run this script: npm run e2e