diegonetto / generator-ionic

Build hybrid mobile apps using the Ionic Framework
MIT License
1.74k stars 336 forks source link

How to debug Unit Test? #217

Closed hwong668 closed 9 years ago

hwong668 commented 9 years ago

What is the proper way to debug unit test with this generator? I have worked with the Angular-Fullstack generator and hooking up Webstorm to debug unit test is as simple as pointing the run config to the karma.conf.js. I've tried to create the karma.conf.js with the same setting as the ones in grunt, but I couldn't get it to work. The break point I setup at the tests or at the implementation code never get tripped.

I've also tried changing the grunt.js karma settings to not use PhantomJS and use Chrome instead. I've tried to do that on the unit and continuous tasks. With grunt karma:unit, I can't seem to see any test getting executed (what's the point of this task?). With grunt karma:continuous, I can get chrome to stop at the tests, but as I step into actual implementation code, the javascript is compress/uglyified.

extra bit of info: I've put my tests under /test/spec/test1.js

Thanks