This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-30
Channels
- # aleph (33)
- # announcements (2)
- # architecture (1)
- # babashka (4)
- # beginners (26)
- # calva (43)
- # cider (2)
- # clerk (24)
- # clj-kondo (10)
- # clojure (75)
- # clojure-austin (1)
- # clojure-dev (4)
- # clojure-europe (31)
- # clojure-hungary (1)
- # clojure-norway (44)
- # clojurescript (4)
- # cursive (192)
- # datomic (23)
- # dev-tooling (4)
- # emacs (2)
- # fulcro (12)
- # hyperfiddle (3)
- # java (18)
- # jobs (1)
- # kaocha (3)
- # lsp (51)
- # malli (10)
- # off-topic (9)
- # pedestal (3)
- # polylith (14)
- # remote-jobs (1)
- # shadow-cljs (63)
- # vim (6)
Hello everyone. I have probably very dumb question, but i really struggle to use cljs.test to test asynchronous code, so i would really appreciate any help. Even very basic example isn't working. I've wrote something like this:
(deftest test-test
(t/async done
(go (is (= 1 0)))
(done)))
and builded it using shadow-cljs build:
:test
{:target :node-test
:output-to *some-dir*
:ns-regexp "Test$"
:autorun true}}}
and when i call shadow-cljs compile test
nothing happens, it says "Ran 1 tests containing 0 assertions. 0 failures, 0 errors."
How do i fix it?try this
(deftest test-test
(t/async done
(go (is (= 1 0))
(done))))
If you write an asynchronous test the last value you return _must_ be the async block.
from here - https://clojurescript.org/tools/testing#async-testing