Unit testing ionic apps

Any examples of writing unit tests for an ionic app using jasmine, karma ?

How to inject ionic module, testing states etc…

write now iam stuck at-


Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module ionic due to:
Error: [$injector:nomod] Module 'ionic' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
1 Like

any suggestions on how to load ionic module for unit test. Iam able to load a mock module. is that the best practice or loading the actual ionic module?

For me reorganizing the karma.conf file solved the problem.
Change order of including your scripts, files and libraries:

// libraries

// scripts

// specs
1 Like

I am new to ionic and will be starting a project using Ionic. Are there any helpful link for Unit Testing ionic apps?

Do we really need ‘www/lib/angular-route/angular-route.js’, when we are using angular-ui-router.