Here's what I'm currently trying and failing with:

(defn new-id
  ([]
   (str "container-" (gensym)))
  ([id]
   (str "container-" id)))

(defn new-node
  [id]
  (-> (dommy/create-element "div")
      (dommy/set-attr! "id" id)))

(defn append-node
  [node]
  (dommy/append! (dommy/sel1 js/document :body) node))

(defn container!
  ([]
   (container! (new-id)))
  ([id]
   (-> id
       new-node
       append-node)))

(deftest result-handlers
  (testing "success"
    (let [c (container! "foo")]
      (reagent/render-component [u/success-component] (dommy/sel1 :#foo)))))

and here is the error:

ERROR in (util.test/result-handlers) (:)
Uncaught exception, not in assertion.
expected: nil
  actual:
TypeError: instanceof called on an object with an invalid prototype property.
    at resources/polyfill.js:13
    at resources/public/js/unit-test.js:1894
    at resources/public/js/unit-test.js:2033
    at resources/public/js/unit-test.js:7316
    at resources/public/js/unit-test.js:7275
    at ReactDOMComponent_mountComponent (resources/public/js/unit-test.js:12373)
    at resources/public/js/unit-test.js:6125
    at ReactCompositeComponent_mountComponent 
(resources/public/js/unit-test.js:12373)
    at resources/public/js/unit-test.js:5158
    at resources/public/js/unit-test.js:15416
    at resources/public/js/unit-test.js:5140
    at resources/public/js/unit-test.js:11256
    at ReactMount__renderNewRootComponent 
(resources/public/js/unit-test.js:12373)
    at resources/public/js/unit-test.js:11325
    at React_render (resources/public/js/unit-test.js:12373)
    at render_component (resources/public/js/unit-test.js:51499)
    at resources/public/js/unit-test.js:53504
    at resources/public/js/unit-test.js:53511
    at resources/public/js/unit-test.js:53498
    at resources/public/js/unit-test.js:53509
    at result_handlers_test (resources/public/js/unit-test.js:82465)
    at resources/public/js/unit-test.js:81617
    at resources/public/js/unit-test.js:81644
    at resources/public/js/unit-test.js:81711
    at default_fixture (resources/public/js/unit-test.js:81424)
    at resources/public/js/unit-test.js:81713
    at default_fixture (resources/public/js/unit-test.js:81424)

and here is the relevant bit from project.cljs:

:client-test {:cljsbuild
                           {:builds
                            {:test
                             {:source-paths ["src/cljs" "test/cljs"]
                              :compiler {:output-to 
"resources/public/js/unit-test.js"
                                         :optimizations :whitespace
                                         :pretty-print true
                                         :preamble ^:replace 
["jquery/jquery-2.1.1.min.js" "reagent/react.js"]}}}
                            :test-commands {"unit-test" ["phantomjs"
                                                         :runner 
"resources/polyfill.js" "resources/public/js/unit-test.js"]}}
                           :dependencies [[prismatic/dommy "1.0.0"]]}

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to