If you are attempting to run Karma unit tests from Webstorm in Ubuntu 12LTS you may run into the following error:
Cannot start Chrome
Can not find the binary google-chrome
Please set env variable CHROME_BIN
Attempting to export CHROME_BIN=/usr/bin/chromium-browser worked great for running karma from the command line, but did not fix my issue when running it from within Webstorm, so after a bit of searching I found that you can add environment variables to webstorm by editing the Run/Debug Configurations for Karma:
- Under Run > Edit Configurations...
- Select Karma > karma.conf.js
- Add the Environment Variables:
CHROME_BIN=<path to chromium-browser>
- To find the location of chromium-browser:
which chromium-browser
You can fix this problem by: http://karma-runner.github.io/0.8/config/browsers.html
ReplyDelete