bensu / doo

doo is a library and lein plugin to run cljs.test on different js environments.
Eclipse Public License 1.0
324 stars 63 forks source link

Issues with testing with Chrome-headless #189

Open Wolfgang51 opened 5 years ago

Wolfgang51 commented 5 years ago

Hey there, I am trying to run test using chrome-headless. Per the documentation I ran the following commands inside my project

npm install karma karma-cljs-test --save-dev
npm install -g karma-cli
npm install karma-chrome-launcher karma-firefox-launcher --save-dev

When I run my tests with lein doo chrome-headless test once I get the following error

;; ======================================================================
;; Testing with Chrome-headless:

'karma' is not recognized as an internal or external command,
operable program or batch file.
Subprocess failed

I checked to make sure all the modules exist and they do, they are located in ./npm-modules/. Moreover, I ran karma start inside the node_modules\.bin and it didn't throw an error. Any ideas?

Wolfgang51 commented 5 years ago

After some digging and debugging I found the issue was with Windows specifically. I have a suspicion that npm had updated and installs karma in a different directory that it used too. The reason I say that is that the setup of doo, karma and chrome-headless used to work for us. To fix our issue, we manually pointed doo to karma by adding the following to our project.clj

:paths {:karma "node_modules\\.bin\\karma"}

Note: the readme shows an example of this as

:doo {:paths {:karma "path/to/node_modules/karma/bin/karma"}}

This path will not work for windows so keep in mind that you need to use use escape characters for the windows path.

bensu commented 5 years ago

Thank you! We should update the docs with that information, I will leave this issue open until we do.