This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-16
Channels
- # beginners (21)
- # boot (6)
- # cider (47)
- # clojure (67)
- # clojure-brasil (2)
- # clojure-dusseldorf (3)
- # clojure-greece (2)
- # clojure-quebec (3)
- # clojure-russia (8)
- # clojure-spec (110)
- # clojurescript (19)
- # cursive (8)
- # datomic (5)
- # devcards (2)
- # dirac (9)
- # editors (1)
- # emacs (3)
- # funcool (1)
- # lein-figwheel (7)
- # om (1)
- # protorepl (2)
- # re-frame (1)
- # testing (1)
@krchia: according to the doc, d3.event
is a global value and may be nil. https://github.com/d3/d3-3.x-api-reference/blob/master/Selections.md#d3_event
@krchia: as an example, this bit of code works as expected:
(let [n (gdom/getElement "btn")]
(-> d3
(.select n)
(.on "click" (fn [] (js/console.log (.-event d3))))))
For this example, you should see something like MouseEvent {…}
in the dev console when btn
is clicked
@krchia: I realised that @seancorfield has already answered your question in #C053AK3F9 channel
Also wondering whether there is a precedent for testing CLJS code (that doesn't interact with the DOM/environment) under Clojure instead of in a headless session/browser runner?
@danthedev: Specter uses a decent amount of test.check
(but it is more of a library usable from ClojureScript)
If the tests are written with cljs.test.check as cljc is there likely to be friction trying to run them under Clojure?
Or would the more sane approach be to pull all non-environment code out of the frontend into cljc files and just test with clojure.test.check?
Hi all, does anyone have advice on best practices for installing a cljs+nodejs command line app?
specifically, “lein npm install” seems to be failing, and any cljsbuild :optimization other than :none doesn’t run, and :none sprays files everywhere in the output directory
(I am not an expert on npm, so its quite possible I just need to do something with npm that I don’t currently understand
@danthedev It would be better to really compile your code into JS and run tests in [headless] browser if you want to test that it works as CLJS 🙂 But maybe I'm not really sure what problem you are trying to solve.