kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
dharrigan 2020-09-23T09:58:07.001100Z

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?

dharrigan 2020-09-23T10:03:27.001300Z

ah it's okay

dharrigan 2020-09-23T10:03:35.001600Z

nvm 🙂 it works with use-fixtures too 🙂

dharrigan 2020-09-23T10:09:37.002100Z

but, out of curiosity, is there a way?

plexus 2020-09-23T14:56:52.002700Z

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

plexus 2020-09-23T14:57:39.003500Z

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

dharrigan 2020-09-23T14:58:39.003700Z

🙂

dharrigan 2020-09-23T14:58:40.003900Z

Thanks! 🙂

jeaye 2020-09-23T19:02:48.009800Z

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.

jeaye 2020-09-23T19:03:41.010100Z

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

jeaye 2020-09-23T19:12:21.010400Z

Here's the trivial reproduction: https://gist.github.com/jeaye/a153a8ae397001df49778866e02a7c49

jeaye 2020-09-23T19:16:46.013600Z

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.

jeaye 2020-09-23T19:36:02.014100Z

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