Fork me on GitHub
#kaocha
<
2020-07-22
>
ikitommi19:07:35

how should the preloads work? this doesn’t seem to work:

#kaocha/v1
{:tests [{:id   :unit
          :type :kaocha.type/clojure.test}
         {:id   :unit-cljs
          :plugins [:preloads]
          :kaocha.plugin.preloads/ns-names [sci.core]
          :type :kaocha.type/cljs}]}

ikitommi19:07:56

tried also adding those to top-level, with no luck.

plexus06:07:46

Definitely should be at the top level, this doesn't work?

#kaocha/v1
{:plugins [:preloads]
 :kaocha.plugin.preloads/ns-names [...]}

plexus06:07:32

plugin is really simple

(defplugin kaocha.plugin/preloads
  (pre-load [config]
    (when-let [ns-names (::ns-names config)]
      (apply require ns-names))
    config))

plexus06:07:17

but... I guess you're trying to preload cljs code? that won't work

plexus06:07:49

but you might be able to use the clojurescript compiler preloads option

plexus06:07:45

#kaocha/v1
{:tests [{:id   :unit
          :type :kaocha.type/clojure.test}
         {:id   :unit-cljs
          :type :kaocha.type/cljs
          :cljs/compiler-options {:preloads [...]}}]}