This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-15
Channels
- # ai (35)
- # announcements (3)
- # babashka (16)
- # babashka-sci-dev (2)
- # beginners (37)
- # biff (16)
- # calva (5)
- # cider (2)
- # clj-commons (81)
- # clj-kondo (29)
- # cljfx (2)
- # cljs-dev (4)
- # clojars (4)
- # clojure (92)
- # clojure-europe (72)
- # clojure-losangeles (8)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (1)
- # clojurescript (20)
- # clojutre (2)
- # conjure (2)
- # data-science (18)
- # datomic (1)
- # emacs (10)
- # fulcro (49)
- # joyride (1)
- # kaocha (23)
- # leiningen (8)
- # lsp (14)
- # meander (5)
- # off-topic (93)
- # polylith (4)
- # re-frame (20)
- # reagent (9)
- # reitit (2)
- # remote-jobs (8)
- # sci (1)
- # shadow-cljs (21)
- # testing (3)
- # vim (27)
- # xtdb (35)
Interesting 🙂 I like the idea of name tests over concepts, that makes good sense. Regarding the first question, in RSpec you get the structure of describing the tests for free:
describe "when there is one variant" do
it "creates one variant" do
expect { ... }
end
end
Where do you stand on writing testing
blocks like this? When there is one variant, it creates one variant
or Given there is one variant, it creates one variant
. Do you have any other convention och preferred way of writing?Of course this is not the most important aspect in the world, but I would like to introduce a standard to our project so that the tests don’t look so messy
@robin.saaf I kinda sorta took that approach for https://github.com/cljdoc/cljdoc/blob/a33d1eea3bb7cd832f92e84f985f22197a037c54/test/cljdoc/util/fixref_test.clj#L17-L158.
Everything has its pros and cons... I like this for this particular test because it helped me to think about variants, and the test output is very descriptive.
A downside is that it is a bit harder to extract an individual test in the REPL, especially when the testing
blocks depend on some setup in the deftest
.
I guess also: run order of testing
blocks is not randomized.