Community Health Toolkit

Running the tests in WSL

I’m trying to run the unit tests in my environment (WSL), but the tests won’t run because they time out before they can capture chrome. More specifically, I run grunt unit and the error message is 14 05 2020 21:28:03.989:WARN [launcher]: Chrome have not captured in 60000 ms, killing.

Does anyone have advice for this situation? Should I use a Linux VM instead?

1 Like

I haven’t tried testing under WSL. While it is technically supported the core developers either use Linux or Mac. However, my guess is that the WSL can’t find the Chrome installation. Have you set up the CHROME_BIN environment variable? There’s some info here: https://stackoverflow.com/questions/54090298/karma-use-windows-chrome-from-wsl

I had already set the CHROME_BIN environment variable to point at Windows Chrome. It turns out that the problem was actually Chrome_Headless. When I changed it to just be Chrome in Gruntfile.js’s karma configurations, it opened up a browser window on the Windows side and the tests started running.