I am trying to launch karma from WSL using the Windows version of Google Chrome.
In the karma.conf.js I simply use the Chrome browser:
[...],
browsers: ['Chrome'],
[...]
And I export the CHROME_BIN environment variable like this:
export CHROME_BIN='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
Karma successfully find Google Chrome, and a new tab is opened at the right URL when Karma is launched. However, I get this error:
Google chrome can't read and write to its data directory /tmp/karma-XXXX
I tried starting chrome as administrator and changing the cache folder to the root of my project but it doesn't work.
I assumed there was a issue with the format of the path that Karma give to Chrome (WSL path vs Windows path).
So I create a custom karma launcher specifying the chromeDataDir:
browsers: ['WindowsChrome'],
customLaunchers: {
WindowsChrome: {
base: 'Chrome',
chromeDataDir: 'D:\\'
}
}
By doing that a I don't have the previous error, a new instance of Chrome is launched but Chrome seems unable to resolve the URL, and karma timeout. Moreover, a lot of Chrome folders are created inside my project.
Have someone already make karma work from WSL using Chrome or have any cue on what is going on ?