This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-16
Channels
- # announcements (1)
- # babashka (13)
- # beginners (33)
- # calva (26)
- # cherry (33)
- # clerk (5)
- # clj-kondo (3)
- # clojure (40)
- # clojure-europe (24)
- # clojure-finland (2)
- # clojure-norway (29)
- # clojurescript (18)
- # cursive (2)
- # datomic (6)
- # docker (11)
- # emacs (12)
- # events (1)
- # fulcro (71)
- # graalvm (8)
- # hyperfiddle (2)
- # lsp (23)
- # meander (5)
- # off-topic (36)
- # polylith (4)
- # re-frame (6)
- # reitit (13)
- # shadow-cljs (87)
- # spacemacs (1)
- # tools-deps (19)
- # vim (5)
- # xtdb (57)
There is a way to run a single test in cljs.test ? I expecting something like this on jest: https://jestjs.io/docs/setup-teardown#general-advice
test.only(() => {});
Perhaps http://cljs.github.io/api/cljs.test/test-vars which lets you explicitly run one or more test?
but how I can use that? I'm not using REPL, I'm just running shadow-cljs watch process with autorun
Ah, I always use a REPL and almost never have a watch process running...
I mean I find that all api is REPL orientend and it is ok, but this is not the only way to it. I'm not always connected to REPL (in clojurescript)
this is also interesting to have this for run a single test in CI, where you obviously don't hava a REPL connection
the problem here I guess is that the api is 100% oriented to be run on REPL session (which is ok but limiting because there are also other approaches for do it without having the REPL setup on clojurescript)
I don't understand why you'd want CI to run just a single test? That seems contrary to the whole point of CI.
This is not the point, the point is I want a shell running watch test. And just execute the test on each modification, without the need to eval on the REPL an expr for running the test
Right now the solution to this problem is: go to all other ns and comment the tests while you develop X feature. And no... the REPL is not an option here, because I don't want constantly go to a buffer on emacs for eval an expr for running a test, I want the single test running on each save, without the need to switch my context to the REPL.
My workflow is a bit different but it does not makes it worse or better than others, just that the cljs.test right now is oriented to REPL workflow that In my concrete case I don't use, so I'm limited to the rudimentary solution to comment tests hehe
Depending on your test runner, maybe you could use metadata tags on your tests and configure the runner to run only tagged tests?
(deftest ^:only some-test ...)
and then tell the runner to only run tests with the :only
metadata?
I don't know if that's possible in ClojureScript, but the Clojure test runners all support that I believe.
yep, that is something I thinking, yes, I asked if there are something already done before going to implement it.