Skip to content

unit testing

Richard Lasjunies edited this page Jan 5, 2018 · 7 revisions

Unit testing

Installation

https://github.com/ionic-team/ionic-unit-testing-example/tree/ionic-v2-branch

Tuto on unit testing

https://www.joshmorony.com/introduction-to-testing-ionic-2-applications-with-testbed/

http://www.joshmorony.com/how-to-unit-test-an-ionic-2-application/

https://developers.livechatinc.com/blog/testing-angular-2-apps-dependency-injection-and-components/

https://leifwells.github.io/2017/08/27/testing-in-ionic-configure-existing-projects-for-testing/

https://leifwells.github.io/2017/09/05/testing-in-ionic-code-coverage/

https://github.com/ionic-team/ionic-unit-testing-example/tree/ionic-v2-branch

https://semaphoreci.com/community/tutorials/testing-services-in-angular-2

https://auth0.com/blog/angular-2-testing-in-depth-services/

Code coverage info

How to exclude some part of the code from code coverage

https://stackoverflow.com/questions/30327830/excluding-files-from-coverage-when-using-mocha-and-istanbul

Code coverage with E2E tests

https://medium.com/@the1mills/front-end-javascript-test-coverage-with-istanbul-selenium-4b2be44e3e98

https://github.com/ORESoftware/express-istanbul

https://github.com/gotwarlost/istanbul-middleware https://github.com/gotwarlost/istanbul/issues/132

https://github.com/mahuntington/e2e-istanbul

https://www.jujens.eu/posts/en/2015/Sep/25/code-coverage-istanbul-protractor/

https://www.npmjs.com/package/grunt-protractor-coverage https://github.com/bennyhat/protractor-istanbul-plugin

Run

  • npm test
  • npm run test-coverage

test coverage produce a report in the folder: ./coverage

Clone this wiki locally