This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-18
Channels
- # announcements (17)
- # babashka (42)
- # beginners (34)
- # calva (78)
- # cherry (1)
- # cider (7)
- # clojure (64)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-norway (54)
- # clojure-uk (3)
- # clojurescript (21)
- # cloverage (1)
- # conjure (1)
- # core-async (11)
- # cryogen (16)
- # cursive (1)
- # data-oriented-programming (1)
- # datahike (5)
- # fulcro (2)
- # girouette (1)
- # helix (10)
- # hyperfiddle (1)
- # jobs (1)
- # kaocha (4)
- # nbb (7)
- # off-topic (6)
- # pathom (4)
- # polylith (21)
- # rdf (9)
- # releases (2)
- # shadow-cljs (3)
- # sql (12)
- # squint (68)
- # vim (33)
- # xtdb (29)
Hello. How do you run a single cljs.test/deftest
, not the whole namespace through reporting? (`run-tests` works fine for the whole namespace). Running (`my-test`) doesn't go through reporting. My environment is react-native
so I don't want to investigate a framework intended for the browser. My output is appended to the android console, I'd like to colour highlight the failure status of the test, to distinguish it from significant other output.
I suspect you can't, and it wasn't intended to be run this way... but run-tests
is terse code that is doing a lot, so I thought I'd ask before attempting to either write my own runner, or delve into it.
@U05224H0W Thanks, but this doesn't appear to write the results to the report so that I can use (defmethod cljs.test/report ...
. It just runs a test in isolation.
As per usual, it helps to understand the code (which I was trying not to have to 😅). I can solve my problem by overriding (defmethod cljs.test/report [:cljs.test/default :fail]..
instead of the :end-run-tests
from the documentation. Then it doesn't matter how I run the test on the outside. The report
function appears to be used everywhere.
Admittedly it solves my objective, but not as asked.
from https://clojuredocs.org/clojure.test and from https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/test.cljs >
In that case, you must define a special function
> named "test-ns-hook" that runs your tests in the correct order:
>
> (defn test-ns-hook []
> (arithmetic))
>
> Note: test-ns-hook prevents execution of fixtures (see below).
So as long as you don't need fixtures, you should be able to simply define the function test-ns-hook
and list off the tests you want to run.
The intended purpose of this function is to let you compose tests together, then list only the composite tests to run.one of the assets I need, rc-picker
, has a file node_modules/rc-picker/assets/index.less
that needs to be compiled. How can I make this happen using shadow-cljs?
I have used node-sass, tailwind, and a couple of my own tools (which basically just concatenated a few files together)
interesting. So when you use a third party library that has a .less file, do you hard code for it to be compiled or is it a more automatic process?
I have never used a library that required me to use a .less file, so cannot answer that 😉
I have used libs that wanted .css and I just added to them my "build" command (which at times where just bash files, newer ones had clojure functions)
cp src/css/main.css public/css/main.css && cat node_modules/rc-picker/assets/index.css >> public/css/main.css
could be all you need 😛