unit testing - rlasjunies/kct GitHub Wiki
Unit testing
Installation
https://github.com/ionic-team/ionic-unit-testing-example/tree/ionic-v2-branch
Tuto on unit testing
-
all topics explained
http://angulartestingquickstart.com/#testing-template -
Setup tests
-
Basic test component app
-
Basic test Home page
https://www.joshmorony.com/introduction-to-testing-ionic-2-applications-with-testbed/ -
overall installation including e2e setup
https://leifwells.github.io/2017/08/27/testing-in-ionic-configure-existing-projects-for-testing/ -
installation including code coverage
https://leifwells.github.io/2017/09/05/testing-in-ionic-code-coverage/ -
Basic details on how to use jasmines/expect
http://www.joshmorony.com/how-to-unit-test-an-ionic-2-application/ -
Test service, component, quick explanation of mock
https://developers.livechatinc.com/blog/testing-angular-2-apps-dependency-injection-and-components/ -
Mocking, spyon,
https://auth0.com/blog/angular-2-testing-in-depth-services/ http://angular-tips.com/blog/2014/03/introduction-to-unit-test-spies/
https://github.com/ionic-team/ionic-unit-testing-example/tree/ionic-v2-branch
https://semaphoreci.com/community/tutorials/testing-services-in-angular-2
Code coverage info
How to exclude some part of the code from code coverage
Run
npm testnpm run test-coverage
test coverage produce a report in the folder:
./coverage