Hi Team
I I doing unit test cases in Ionic app but facing problem when trying to get code coverage.
Expected Behaviour
When I run command npm test --code-coverage then it should create coverage folder in root of project and inside that folder index.html file should created which will show code coverage
What I have done:
1.Tried in current project but its not working and giving some random error about module not added in entrycomponent. I have checked 2 times all files everything is correct
2.Create new project of Angular. In that project coverage project already created and its working
3.Create new project of Ionic with latest Ionic cli but their also no coverage folder created .
Overall no code coverage working in Ionic and also no coverage folder created in Ionic.
npm run test working perfectly in Ionic projects
but
when trying
npm run test-coverage command then its giving just success and failure test case
Took reference from below links but nothing worrks
1.https://leifwells.github.io/2017/09/05/testing-in-ionic-code-coverage/
2.https://github.com/ionic-team/ionic-unit-testing-example
3.https://ionicframework.com/docs/building/testing
If anyone knows solution please respond.
Thanks