Using Ionic with jasmine-karma, while run test, getting success compile but in jasmine dashboard getting empty screen with error in console.
Following tutorial : https://leifwells.github.io/2017/08/27/testing-in-ionic-configure-existing-projects-for-testing/
"ts-loader": "^4.1.0",
"jasmine-core": "^2.99.1"
Error Messages :
TypeError: env.stopOnSpecFailure is not a function at adapter.js:26
Error: Module build failed: TypeError: Cannot read property 'afterCompile' of undefined
The failure occurs in your version of karma-jasmine which tries to use the stopOnSpecFailure function. That function is not present in your version of jasmine-core, you'll need version 3 or greater. Version 3.1.0 is the newest right now and works good. Also note that if you're using Webpack 3 you should also downgrade ts-loader to 3.5.0.
UPDATE:
I noticed that many people suggests downgrading jasmine-core to 2.99.1. Apparently people have problems using jasmine-core 3. If that's the case for you, then you can use karma-jasmine-html-reporter version 0.2.2 together with jasmine-core 2.99.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With