How to configure karma / jasmine to work with ionic2?

Ionic2 was written using typescript and is based on angular2. Can I write a unit test and e2e test for this? If possible, how can we do this?

Sorry for my knowledge in the field of testing, I do not have much experience in karma and jasmine.

+5
source share
2 answers

My colleague created a simple Counter application with karma / jasmine tests.

Take a look here: https://github.com/lathonez/clicker

Updated to ionic2 (2.0.0-beta.0) and Angular2 (2.0.0-beta.3) - try and open the problem if you need help.

+6
source

Here is Ionic 2 ( Ionic rc0 )) to launch new projects. This template will follow best practices for angular and ion development.

It provides you with all the available NPM script commands:

  • dev : start the ion service
  • build : Complete build. Use flag to build dev.
  • release : create a change log based on commits
  • push : shortcut for git push origin master --follow-tags
  • lint : lint with tslint
  • scss-lint : lint scss
  • test : Karma test runs
  • e2e : runs e2e transporter tests
  • e2e:interactive : runs the e2e transporter tests interactively
  • docs : not working yet
  • outdated : look for npm packages for legacy dependencies
  • ios:dev : build.ipa using dev environment vars
  • ios:release : build.ipa with vars production environment
  • android:dev : build .apk using dev environment vars
  • android:release : build .apk with vars production environment

It's in development, but I already thank Marco Turi for this!

+1
source

Source: https://habr.com/ru/post/1238536/


All Articles