When i am trying to config and run the .sh
file in local environment, getting this error:
Error: The '@angular-devkit/build-angular/plugins/karma' karma plugin is meant to be used from within Angular CLI and will not work correctly outside of it.
I tried to use CLI but its not worked for me.
Please help me to resolve this issue.
The following file I have created to execute karma.
run_unit_test.sh
./node_modules/karma/bin/karma start src/karma.conf.js
I got this error in my WebStorm and I noticed that in
Run/Debug Configurations — Karma package input, was wrong package path - path_to_project/node_modules/karma
Error gone when I set it to: path_to_project/node_modules/@angular/cli
I know that I'm late with this answer and that this doesn't quite fit your situation. But I know that people with a similar problem often get here and I will leave this post for them.
For me wrapping this call into ng
fixed it:
ng test --karma-config src/karma.conf.js
It seems this was a break sometime around angular 6 release.
In my case specifically I actually used
ng test --karma-config karma.conf.js --browsers Chrome_with_debugging
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