ANN: RCF, a REPL-first test macro for Clojure/Script (now with async tests!)

47 views
Skip to first unread message

Dustin Getz

unread,
Nov 4, 2021, 6:57:56 PM11/4/21
to Clojure
RCF turns your Rich Comment Forms into tests. No watchers, no beeping, no lagging, no boilerplate. One key-chord to run tests (send form or file to repl). Try it, it's good! https://github.com/hyperfiddle/rcf/

Changes: Async support for RCF test blocks is now available! Now develop async expressions at your REPL, with the full Clojure interactive experience.

(ns example
  (:require [hyperfiddle.rcf :as rcf :refer [tests ! %]]
            [clojure.core.async :refer [chan >! go go-loop <! timeout close!]]))

(tests
  "core.async"
  (def c (chan))
  (go-loop [x (<! c)]
           (when x
             (<! (timeout 10))
             (rcf/! x)              ; tap to queue
             (recur (<! c))))
  (go (>! c :hello) (>! c :world))
  % := :hello                       ; pop queue
  % := :world
  (close! c))


Reply all
Reply to author
Forward
0 new messages