testing ionic with karma & jasmine..

things to check:

– angular and angular-mocks version (bower line) must match the used version in ionic (look into bundles files?)!

>ionic --version
>npm install karma karma-jasmine karma-phantomjs-launcher jasmine-core --save-dev
>npm install angular-mocks --save-dev
>npm install -g karma-cli
>npm install
>bower install angular-mocks#1.3.13
>karma init karma.conf.js

inside karma.config.js (ORDERING IS RELEVANT!):

 // list of files / patterns to load in the browser
 files: [
 './tests/**/*.js' ],

now run tests with:

>karma start
(or variants like karma start --browsers=Chrome --singleRun=true)

pleaze, do not expect an expert here, better use: http://mcgivery.com/unit-testing-ionic-app/


Published by


totask2 account

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s