I would like to run karma tests using Firefox under WSL. I have firefox installed via apt and it is working using VcXsrv in Windows. When I use karma-firefox-launcher, however, I get a "Cannot start Firefox" error. Has anybody successfully gotten this to work? If so, how?
Hello I've faced with this problem, but instead of FF it was the Google chrome, and it took awhile to figure it out. So I'll publish my solution here, maybe it can help someone.
If you are windows user on WSL and you are trying to run ng test
you will get an error which says
No binary for Chrome browser on your platform. Please, set "CHROME_BIN" env variable.
Reason is that actually you don't have chrome on you linux machine and you are trying to run your tests in it.
My solution is to create an alias from linux to windws's chrome
alias launchchrome="\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\""
and after that export it as a linux env variable
export CHROME_BIN=launchchrome
That's it, now if you run ng test
your standard chrome will be used!
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