Fork me on GitHub
#clojurescript
<
2016-07-16
>
rohit11:07:15

@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

rohit11:07:34

so (.-event js/d3) => nil makes sense if there is no event bound to it.

rohit11:07:47

@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))))))

rohit11:07:46

For this example, you should see something like MouseEvent {…} in the dev console when btn is clicked

rohit11:07:24

@krchia: I realised that @seancorfield has already answered your question in #C053AK3F9 channel

danthedev11:07:08

Can anyone point me towards a well tested CLJS project using test.check?

danthedev11:07:58

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?

mfikes12:07:15

@danthedev: Specter uses a decent amount of test.check (but it is more of a library usable from ClojureScript)

danthedev12:07:07

Thanks @mfikes, that's perfect.

danthedev12:07:06

If the tests are written with cljs.test.check as cljc is there likely to be friction trying to run them under Clojure?

danthedev12:07:10

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?

ghaskins12:07:29

Hi all, does anyone have advice on best practices for installing a cljs+nodejs command line app?

ghaskins12:07:43

im struggling to find any info via the web

ghaskins12:07:54

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

ghaskins12:07:31

(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

ghaskins15:07:15

I am currently using leiningen, cljsbuild, and lein-npm in case it matters

sdegutis17:07:46

What are the full stack Clojure/script web app options?

metametadata19:07:46

@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.

krchia19:07:23

@rohit, yes but thanks still 🙂