Fork me on GitHub

does clojure.test.check.clojure-test/defspec work with shadow-cljs’s built-in test runner?


@steedman87 if you use the latest version yes. older versions didn't.

👍 5

Oh, wow I was several versions behind. They new in-browser test runner looks amazing!


And of course defspec works now 😁


Hey! Are requires outside of nss supported in shadow (or cljs, for that matter) This (admittedly old) blog indicates that it would be possible When trying it on a cljc file, it fails with:

CompilerException: java.lang.RuntimeException: Feature should be a keyword: (require (quote [clojure.spec.alpha])), compiling:(.../spec.cljc:12:35)
regardless of it being wrapped in a #?:clj, #?:cljsor nothing


no they are not supported since it doesn't provide any feature you wouldn't get by putting in in the ns in the first place


you can't do conditional includes that way if that is what you were trying to do

👌 5

Ok, thanks! That is precisely what I'm trying to achieve... is it possible with some other technique?

Pavel Klavík20:01:51

Hi, I am trying to get shadow-cljs setup running. I am using Cursive and would like to connect its REPL to the browser session. After starting shadow-cljs watch app, I get: shadow-cljs - nREPL server started on port 9000 When I connect to it, it is a Clojure REPL instead, not connected to browser. (Things like (js/console.log "Test") fail with RuntimeException.)


that is normal and intended


you need to switch the CLJ repl to the CLJS repl of your build


so (shadow/repl :app)


@thheller did that change from (shadow/nrepl-select :build-id)?


(shadow.cljs.devtools.api/repl :app) in case the alias isn't setup correctly


@steedman87 no. repl automatically calls nrepl-select when in nrepl context


ah good to know

Pavel Klavík20:01:07

I see, that is little bit confusing.

Pavel Klavík20:01:51

Any way to automate this, so I don't have to type it on every start?


I'm not sure if Cursive has this built in, but in Emacs/CIDER when I run my ClojureScript jack-in command in a shadow-cljs project, it asks me which build I want to select and runs that command for me


@pavel.klavik you can create a custom REPL command and bind it to a key


or just use the REPL history

Pavel Klavík20:01:47

ok, that solution is good enough

Pavel Klavík20:01:29

btw. the tool looks great, it is good that I finally can easily add JS libraries to the project 🙂