Fork me on GitHub
#kaocha
<
2020-09-23
>
dharrigan09:09:07

What would be the equilvant of (use-fixtures :once around-all) in kaocha? I'm looking at the hooks documentation and it's not obvious. Maybe I'm looking in the wrong place?

dharrigan10:09:27

ah it's okay

dharrigan10:09:35

nvm 🙂 it works with use-fixtures too 🙂

dharrigan10:09:37

but, out of curiosity, is there a way?

plexus14:09:52

not sure what you're looking for @dharrigan? the equivalent of use-fixtures is use-fixtures 😄

plexus14:09:39

if you want to run code once before/after all tests, then pre-test and post-test hooks are the way to go

dharrigan14:09:40

Thanks! 🙂

jeaye19:09:48

I'm seeing a crazy issue with kaocha + cljsbuild. My kaocha tests are meant to be spawning children from a JS file which is compiled by a watching cljsbuild, so I need both running at the same time. However, if I have a completely unrelated directory with a main.js in it, kaocha runs it and the kaocha tests start failing with Failed cleaning up ClojureScript runtime and {:cljs/last-val "nil", :ws/disconnected? true, :ws/connected? false}. This would mean that kaocha is globbing or somehow running JS it's not meant to be running.

jeaye19:09:41

Fortunately, I've made a super simple reproduction case.

jeaye19:09:46

So, I've tested a bunch of different ways and it seems that this is limited to directories which are output dirs, but, in my case, target-headless-child is only the output dir in an entirely different lein profile. It has nothing to do with the headless-parent build. The fact that kaocha is running this JS is mainly an annoyance, since I'm unable to run my parent tests which require the child JS to be there for spawning workers, it's potentially also a security concern.

jeaye19:09:02

Second time in two days, but I'm pinging you again, @plexus. 🙂