This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-26
Channels
- # adventofcode (2)
- # announcements (9)
- # bangalore-clj (1)
- # beginners (158)
- # calva (32)
- # cider (2)
- # clara (4)
- # cljdoc (40)
- # cljs-dev (3)
- # cljsrn (6)
- # clojure (45)
- # clojure-brasil (2)
- # clojure-dev (35)
- # clojure-europe (9)
- # clojure-italy (7)
- # clojure-nl (2)
- # clojure-uk (29)
- # clojurescript (144)
- # code-reviews (3)
- # core-logic (9)
- # cursive (11)
- # datascript (8)
- # datomic (9)
- # duct (1)
- # figwheel (6)
- # fulcro (11)
- # hyperfiddle (27)
- # kaocha (23)
- # luminus (1)
- # off-topic (7)
- # onyx (2)
- # pathom (3)
- # re-frame (61)
- # reagent (12)
- # remote-jobs (10)
- # shadow-cljs (40)
- # spacemacs (4)
- # sql (27)
- # tools-deps (6)
- # unrepl (3)
- # vim (47)
Does kaocha support running some expressions before the tests start? Specifically, I would use this to call clojure.spec.test.alpha/instrument
to instrument some vars for all tests
Just came here to ask the same thing. I see the changelog says Function specs are now checked with orchestra + expound
– not sure if this means Kaocha's specs or the specs in the system under test.
@miikka I guess those are fns that kaocha itself uses. Instrumentation of user fns should always be a choice.
I guess this doesn’t have an effect on user specs, since those are not loaded at this point: https://github.com/lambdaisland/kaocha/blob/bd185bff9d4d6e97bc4af9bca0987c6b8e59e098/src/kaocha/runner.clj#L20
ClojureScript support is not yet there, I've started on it but it's still gonna be a good bit of work
that said I do aim to have at least a first working version before the Clojurists Together funding runs out, hopefully I'll have something to show earlier e.g. by the end of the year
right now I’m fine with cljs-test-runner (a similar thing like clj-test-runner from cognitect, which is really minimal), but just wondering, since those do not have the option to “plugin”, now I have to workaround by relying on the alphabetical ordering of namespaces…
(ns my.app.kaocha-hooks
(:require [kaocha.plugin :refer [defplugin]]))
(defplugin
(pre-run [test-plan]
;; do your thing
(... instrument ...)
;; make sure to return the argument
test-plan))
;; bin/kaocha --plugin
;; {:plugins [:]}
if you’re looking for a test case for clj+cljs: https://github.com/borkdude/advent-of-spec