rcf icon indicating copy to clipboard operation
rcf copied to clipboard

rcf/set-timeout! not having effect at node REPL

Open dustingetz opened this issue 3 years ago • 1 comments

(ns dustin.y2021.hello_node_repl
  (:require [hyperfiddle.rcf :as rcf :refer [tests ! %]]
            ["plaid" :as plaid-api]))

(hyperfiddle.rcf/set-timeout! 100)
(tests
  hyperfiddle.rcf/*timeout* := 100
  (defn setTimeout [f ms] (js/setTimeout ms f))
  (rcf/! 1) (setTimeout 10 (fn []
  (rcf/! 2) (setTimeout 200 (fn []
  (rcf/! 3)))))
  % := 1
  % := 2
  % := ::rcf/timeout)
✅
✅
✅
❌ dustin/y2021/hello_node_repl.cljs:6:1
  in %42888
  expected: :hyperfiddle.rcf/timeout
    actual: 3

dustingetz avatar Dec 04 '21 21:12 dustingetz

Directly configuring :timeout works:

(tests {:timeout 100}
  hyperfiddle.rcf/*timeout* := 100
  (defn setTimeout [f ms] (js/setTimeout ms f))
  (rcf/! 1) (setTimeout 10 (fn []
  (rcf/! 2) (setTimeout 200 (fn []
  (rcf/! 3)))))
  % := 1
  % := 2
  % := ::rcf/timeout)
✅
✅
✅
✅

dustingetz avatar Dec 05 '21 18:12 dustingetz