Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show how to instrument and get code coverage for Angular application #51

Closed
bahmutov opened this issue Jul 24, 2019 · 10 comments · Fixed by #58
Closed

Show how to instrument and get code coverage for Angular application #51

bahmutov opened this issue Jul 24, 2019 · 10 comments · Fixed by #58
Labels

Comments

@bahmutov
Copy link
Contributor

Would be nice to show an application scaffolded using https://nx.dev/angular/guides/modernize-cypress with TypeScript and code coverage from end-to-end tests

@skylock
Copy link

skylock commented Jul 30, 2019

In the meantime where I can get the information how to implement this, I'am in exactly this situation, guidance is really appreciated !

I am using angular & cypress & TypeScript with WebPack

@skylock
Copy link

skylock commented Aug 1, 2019

Finally succeed !!! You can find here a working example https://github.com/skylock/cypress-angular-coverage-example

@bahmutov
Copy link
Contributor Author

bahmutov commented Aug 1, 2019

nice, tried it locally and it works @skylock

@bahmutov
Copy link
Contributor Author

🎉 This issue has been resolved in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@stahloss
Copy link

stahloss commented Apr 11, 2020

This this should be revisited, because @skylock implementation uses istanbul-instrumenter-loader, which isn't maintained and has a very old istanbul-lib-instrument dependency.

Maybe there's some way to use babel-plugin-istanbul instead?

EDIT
Just got it working with babel-loader and babel-plugin-istanbul, so you can just replace istanbul-instrumenter-loader and modify the webpack config accordingly.

@skylock
Copy link

skylock commented Apr 11, 2020

Can you point to an github repo with an working example ?

@stahloss
Copy link

See your example repository issue for details.

@Elif5757
Copy link

Finally succeed !!! You can find here a working example https://github.com/skylock/cypress-angular-coverage-example

@skylock it doesn't work with angular version 9.1.4

@LukasKlement
Copy link

@Elif5757 I made code coverage work with Angular 9, I wrote up a quick guide on it: https://lukas-klement.medium.com/implementing-code-coverage-with-angular-and-cypress-6ed08ed7e617

@MohamedSahir
Copy link

MohamedSahir commented Oct 15, 2024

LukasKlement can you update for angular 18 with code coverage in blog or any detail explanation facing issues #893

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants