testing

Testing tools, testing philosophy & methodology...
greg 2021-06-17T15:10:50.052600Z

Is there any data driven testing library out there? Something that would allow to juggle tests like data, in a similar fashion how reitid does routing?

plexus 2021-06-22T05:52:27.062Z

Can you elaborate on what you're looking for? Kaocha is pretty data driven, treating the testing process as a two phase translation process from config to test plan to test result, each of which is a bunch of nested maps.

mauricio.szabo 2021-06-17T19:28:47.055900Z

Hi there! Recently, I've been struggling with async testing in ClojureScript. To ease around my pains, I wrote a library called check, that tries to handle async tests (and keep the same API for Clojure tests) and it's been working really well with me. The thing is: is heavily inspired by midje, and I do know that there are people that don't like this approach. So I was thinking: maybe it could be a good idea to have a "clojure-ish" API and a "midje-ish" API, both pointing to the same implementation? Does anyone struggles with async testing also, and would like to talk so I can see if I can make this library more useful, generic, and documented (and at the same time, more popular)? WDYT?

mauricio.szabo 2021-06-17T19:31:01.057Z

About check: https://github.com/mauricioszabo/check. Here's an example of an async test in CLJS:

(deftest some-async-thing
  (async-test "do some IO and check if things are correct"
    (testing "will get current user"
      (check (fetch...) => {:body {:user {:id 10 :name "Root"}}}))
      
    (testing "will get all users"
      (check (fetch...) 
             => 
             {:body {:users (m/embeds [{:id 10 :name "Root"}])}}))))