This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-31
Channels
- # announcements (2)
- # babashka (145)
- # beginners (260)
- # calva (17)
- # chlorine-clover (7)
- # clj-kondo (9)
- # cljsrn (1)
- # clojure (88)
- # clojure-dev (65)
- # clojure-europe (31)
- # clojure-france (4)
- # clojure-nl (4)
- # clojure-uk (61)
- # clojuredesign-podcast (1)
- # clojurescript (31)
- # code-reviews (1)
- # cursive (32)
- # data-science (2)
- # datascript (9)
- # datomic (39)
- # docker (3)
- # events (1)
- # figwheel (95)
- # figwheel-main (4)
- # fulcro (17)
- # kaocha (2)
- # keechma (1)
- # malli (1)
- # meander (35)
- # nrepl (4)
- # off-topic (1)
- # pathom (8)
- # re-frame (4)
- # reagent (8)
- # reitit (3)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (182)
- # sql (30)
- # tools-deps (89)
- # xtdb (31)
Yeah check track! then. https://github.com/reagent-project/reagent/blob/master/doc/ManagingState.md
Hey! Could someone help me with this error?
expected: (= "2020" (->> (r/as-element [footer-component]) (rtl/render) (.getByText "copyright") (.-innerHTML)))
actual: #object[ReferenceError ReferenceError: document is not defined]
I am trying to test drive my component, and here is the component def:
(ns components.footer-test
(:require
[reagent.core :as r]
["@testing-library/react" :as rtl]
[components.footer :refer [footer-component]]
[cljs.test :refer [deftest testing is use-fixtures]]))
(deftest test-that-copyright-has-correct-year
(testing "Test Correct year in copyright"
(is
(=
"2020"
(-> (r/as-element [footer-component])
(rtl/render)
(.getByText "copyright")
(.-innerHTML))))))
What might be the issue? Do I need to call some function to init the document?Always look at the stacktrace. If it ends up in some JS library, then chances are that the problem is with the usage of that library and not with the CLJS code itself.
I know it is not a problem with CLJS ....
Checking ...
changed :target :node-test
to :target browser-test
. Got it working, thanks a bunch @U2FRKM4TW
👍 3