This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-19
Channels
- # aatree (33)
- # admin-announcements (70)
- # alda (6)
- # aleph (2)
- # announcements (6)
- # aws (7)
- # beginners (40)
- # bitcoin (1)
- # boot (138)
- # cider (24)
- # cljs-dev (9)
- # cljsjs (18)
- # cljsrn (35)
- # clojars (4)
- # clojure (211)
- # clojure-art (4)
- # clojure-austria (2)
- # clojure-hamburg (8)
- # clojure-russia (66)
- # clojure-sg (3)
- # clojured (1)
- # clojurescript (73)
- # cursive (9)
- # datomic (124)
- # dirac (8)
- # editors (3)
- # emacs (13)
- # euroclojure (10)
- # hoplon (207)
- # jobs (4)
- # ldnclj (27)
- # lein-figwheel (3)
- # leiningen (10)
- # mount (5)
- # music (1)
- # off-topic (9)
- # om (92)
- # onyx (36)
- # perun (30)
- # proton (47)
- # re-frame (11)
- # reagent (11)
- # ring-swagger (7)
- # yada (2)
I made a repl! https://jaredforsyth.com/reepl/ w/ auto-complete, auto-documentation, parinfer, and optional vim-mode
@jaredly: works in chromium here, but generates this error in firefox TypeError: document.body.scrollIntoViewIfNeeded is not a function
and a blank screen.
in reagent, what's the difference between r/props and r/state?
hmm, nm it seems the fount of all knowledge is here: https://facebook.github.io/react/docs/component-specs.html
@jaredly: super cool! Sending to my lisp-curious friends
@jaredly: I see you privide quil bindings. Is it possible to draw stuff to the screen already?
@bteuber: nope not at the moment. I’ve got another setup that has repl + code editor + quil canvas
i’ve started work on a boot plugin to handle npm and git dependencies in boot. it’s unfinished but works in principle
otherwise, last i checked, i couldn’t find a complete setup that works, so i opted to roll my own
oh. sorry. i was talking about boot specifically. the lein setup is a different matter
https://github.com/RyanMcG/lein-npm is something i just found, but do not want to go back to lein
@jkrueger: All npm packages are available as Maven dependencies from Webjars, depending on what you need, it could be useful
Not sure if/how it works when running cljs on Node
so i can just use plane https://github.com/adzerk-oss/boot-cljs over a nodejs repl?
@juhoteperi: i wasn’t aware of that. nice !
@kul: I think so. I have never tried running Cljs on Node so I'm not sure what works or doesn't.
I'm trying to write some async tests which also use with-redefs
and I'm having a pesky issue: redef'ed vars in one test are still redef'ed in the next tests. For example:
(def a 1)
(deftest async-test-1
(async
done
(with-redefs [a 2]
(is (= 2 a))
(done))))
(deftest async-test-2
(is (= 1 a)))
;;;; run output:
Testing foo.core-test
FAIL in (async-test-2) (:)
expected: (= 1 a)
actual: (not (= 1 2))
I see that this is caused by how cljs.test runs async tests, where the "next tests" run as a continuation fn which is done
. So in this case they run in the with-redefs
scope. So, is this just something expected?
Found a (hacky) way to "escape the continuation":
(def a 1)
(deftest async-test-1
(async
_done
(let [d (atom false)
done #(reset! d true)]
(js/setTimeout (fn check-done []
(if @d
(_done)
(js/setTimeout check-done 100)))
100)
(with-redefs [a 2]
(is (= 2 a))
(done)))))
(deftest async-test-2
(is (= 1 a)))
Seems like it will work for my problem at handI mean, it works on this simple tests, but it's not that easy with actual async stuff
I'm dealing with some globals here... using with-redefs to kind of "mock" them. To use fixtures I'd need to change more stuff than I'd like/can change now. So, I'll try to make it work this way. Thanks anyways
Sure, sounds like it should work. Maybe I'm dealing with something else now, I have many async requests, some of them trigger other requests, I'm still not sure if I'm stopping everything correctly before callling (done)
. I'll come back as soon as I have all of that more cleared out
@nberger: if you have multiple async things happening in the same test you will want some kind of latch helper
What would be the latch helper? Like a signal for everything to stop? I think I have something like that, but something is escaping it. I'll take a look into the core.async tests
The style of testing that I'm doing here makes it difficult to use something like that. I'm starting my entire app, send signals which triggers the start of xhr requests, which trigger more signals, etc... let's say it's an integration test. My idea was to mock some fns that start requests and return channels, so I can put the exact messages as I want in those channels, etc... It almost works, except it doesn't
I'm not saying it doesn't work... well, one thing that "doesn't work" is to call the continuation fn inside of a with-redefs
scope. It doesn't work in the sense that the next fns run with the redef'ed bindings, which is not what everyone expects. But that might be by design, and that's fine. The latch serves as a way to run the continuation out a scope like that, too
And in my particular case, it might totally be the case that I have some bug or some pesky interaction which makes my tests to hang. I have to dig deeper to find the exact cause. I made some progress though, I'm almost understanding what's happening, so thanks for your help so far in that regard