You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm coming from Angular 12 (although I barely had any tests for Protractor), and would like to start e2e testing with Cypress. I've gotten to a point where I can run my tests without issues, but I'm having a problem with code coverage. I feel like this is barely touched upon in the migration from Protractor guide, even though Angular makes it very easy to use code coverage.
I've now tried both of the options listed in this guide and both are not working for me. It might be relevant to know I have little experience using JS/TS outside of Angular, let alone testing, but it's been a bit of a nightmare.
In my first attempt with NYC, this happened. I've now moved on to Babel, which I think is easier anyway since it removes the step of compiling yourself.
However, this has also not been without issues. I've asked a question on StackOverflow about it here and again, I've hit a brick wall. The problem I had was that there would simply be no code coverage data. Then, following the answer I got, I got an error that I should pass the typescript option (this part is also listed in the StackOverflow question). After googling a bunch to find a solution to this I thought adding this in plugins/index.ts might help:
But now I get an error about tsconfig.readFileSync not being a function.
The problem I have here as someone who is inexperienced is that this part of code coverage is seemingly completely ignored by the guide of both code coverage as well as the Protractor migration guide, and I'm left in the dark. Everything I try leads me to a different branch of troubleshooting when only one branch leads me to the solution, so this entire process is taking a huge amount of time.
Thus, I feel like it would be fitting to include a more in-depth code-coverage part in the Protractor migration guide, especially since Angular have announced to stop supporting Protractor at the end of next year. Of course, I would also greatly appreciate help with this problem in this thread, but because I thought it was important to the Cypress docs I have put it under general discussions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm coming from Angular 12 (although I barely had any tests for Protractor), and would like to start e2e testing with Cypress. I've gotten to a point where I can run my tests without issues, but I'm having a problem with code coverage. I feel like this is barely touched upon in the migration from Protractor guide, even though Angular makes it very easy to use code coverage.
I've now tried both of the options listed in this guide and both are not working for me. It might be relevant to know I have little experience using JS/TS outside of Angular, let alone testing, but it's been a bit of a nightmare.
In my first attempt with NYC, this happened. I've now moved on to Babel, which I think is easier anyway since it removes the step of compiling yourself.
However, this has also not been without issues. I've asked a question on StackOverflow about it here and again, I've hit a brick wall. The problem I had was that there would simply be no code coverage data. Then, following the answer I got, I got an error that I should pass the typescript option (this part is also listed in the StackOverflow question). After googling a bunch to find a solution to this I thought adding this in
plugins/index.ts
might help:But now I get an error about
tsconfig.readFileSync
not being a function.The problem I have here as someone who is inexperienced is that this part of code coverage is seemingly completely ignored by the guide of both code coverage as well as the Protractor migration guide, and I'm left in the dark. Everything I try leads me to a different branch of troubleshooting when only one branch leads me to the solution, so this entire process is taking a huge amount of time.
Thus, I feel like it would be fitting to include a more in-depth code-coverage part in the Protractor migration guide, especially since Angular have announced to stop supporting Protractor at the end of next year. Of course, I would also greatly appreciate help with this problem in this thread, but because I thought it was important to the Cypress docs I have put it under general discussions.
Beta Was this translation helpful? Give feedback.
All reactions