Open lucywang000 opened 4 years ago
Indeed, this is a known issue. Ideally we would hook into Shadow's reloading/watching instead of doing our own, I have some ideas on that but it requires some changes in the watch plug-in so test types can hook into it.
Another problem, I noticed with shadow-cljs watch (and even shadow-cljs server
) that after the second run of tests I am getting compiler errors. It is hard to reproduce all the time but I can suspect :cloverage
and/or :profiling
plugins are involved because where they have used it almost always happens.
In the case of a watch, I have to restart the watch. In the case of shadow-cljs server
, shadow-cljs restart
helps. Additionally, I have to reopen the tab where tests are open (or restart the headless browser).
I started a kaocha watch in shadow-cljs clj-repl, so that everytime the cljs code changes the test could be auto-run.
However kaocha immediately runs the tests after a file change - before shadow-cljs finishes hot reloading. So it's the old code that gets tested, not the most recent version.
So I guess we need a way to let kaocha/chui-remote to "wait for a shadow-cljs reload event and only then run the tests".