Closed gmp26 closed 1 year ago
@gmp26 I was able to configure the browser repl through tests.edn
config like this:
#kaocha/v1
{:tests [{:id :my-cljs-test
:type :kaocha.type/cljs
:cljs/repl-env cljs.repl.browser/repl-env
:cljs/compiler-options {:port 9000
:launch-browser false}}]}
As I understand you can add other repl-env
options described here to the comipler-options
map.
That's a great solution! Thanks for sharing.
Thanks @countgizmo. Just been trying that and although it does prevent a browser being launched, I can only get the tests to work if I manually launch a browser window shortly after launching a single test run. It doesn't help with '--watch' as subsequent tests don't reconnect to the running window successfully, so you end up with this:
Exception: clojure.lang.ExceptionInfo: Kaocha ClojureScript client failed connecting back.
I was afraid this would be the case. Someone will have to hack the browser repl-env to be smarter about reconnecting, until then opening new windows/tabs or running on node or the main options.
@plexus, OK, thanks - node is working for me in this case as I'm not currently testing anything domish, and I guess I can live with the browser relaunch when I do go there. Feel free to close.
We'd welcome an alternative repl-env
but I don't think developing it will be a priority for us.
When running
bin/kaocha :unit-cljs --watch
, every source change launches a new browser window on http://localhost:9000/?rel=xxxxxxx.Is there any way to avoid or configure this behaviour?