view your web page on real browsers … soucelabs

https://saucelabs.com/

totask2.mobile.test.saucelabs.1

Advertisements

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
1.3.22
>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: [
 './www/lib/angular/angular.js',
 './www/js/*.js',
 './www/lib/angular-mocks/angular-mocks.js',
 './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/