This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (6)
- # beginners (89)
- # calva (75)
- # cider (37)
- # clj-kondo (1)
- # cljs-dev (19)
- # cljsjs (8)
- # clojars (1)
- # clojure (122)
- # clojure-europe (6)
- # clojure-italy (41)
- # clojure-nl (18)
- # clojure-uk (24)
- # clojurescript (26)
- # cursive (6)
- # data-science (5)
- # datomic (51)
- # emacs (28)
- # fulcro (8)
- # graalvm (13)
- # hoplon (1)
- # immutant (1)
- # jobs (3)
- # joker (1)
- # keechma (43)
- # lambdaisland (1)
- # leiningen (37)
- # midje (1)
- # nrepl (2)
- # off-topic (32)
- # re-frame (3)
- # reagent (24)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (33)
- # sql (7)
- # tools-deps (11)
I had a couple of questions around self-hosted CLJS if someone has some experience with it? 1. I'm under the impression you can override the line number / file path of the evaluation like you can with a line numbering pushback reader for eval in Clojure? 2. Could I make the self hosted ClojureScript inherit from the parent environment to pick up all dependencies in the outer context? Or is it supposed to be an isolated environment. I mainly just want to be able to set the line number and file path of an evaluation from within a ClojureScript REPL. I think I can only do that through some self hosting trickery, maybe I'm wrong there though :thinking_face: if anyone knows of some fun hacks I can do to change the line number within a CLJS REPL then I'm all ears!
its not possible from within a CLJS REPL without first patching CLJS and adding the funtionality (like it was added to Clojure not long ago)
Oh, I vaguely recall seeing those as bindings somewhere in Clojure. I wonder if it'd be worth submitting a patch for that for parity at some point... hmm.
I'm worried that if I go down the self hosting route I'll just encounter different issues around dependency loading further down the line.
hello dear clojurescripters, is anybody around who can point me to how dynamically create tests in clojurescript? I’ve been fumbling with this for a while and I’m wondering if I’m looking at the problem the wrong way.
The idea is that I have already a set of nicely formatted specifications, and I’d like, for each of them, to do the equivalent of
(deftest test-name test-body).
hi! yes, but this case is a bit more involved: I need to test the result of async functions, and only one of those can live in each test (according to the documentation)
alas: > You cannot have more than one async test per deftest form or only the first one will run.
No idea from my side. Given
(deftest test-name test-body) seems a pretty trivial macroexpansion, you could write that code yourself.
Or if you have far too many specifications, you can create a one-off program that will
(println (pr-str (list 'deftest (gensym) the-specification)))
...and you copy/paste the result into a file
Hi. I have something like that (I think) in my toy project.
Here is the data with name of the test, query to be executed and expected results: https://github.com/nenadalm/Warehouse/blob/721b17f24cc545e44a5bbb101d69f13f203a339e/frontend/test/warehouse/indexeddb_test.cljs#L44. Here all tests run: https://github.com/nenadalm/Warehouse/blob/721b17f24cc545e44a5bbb101d69f13f203a339e/frontend/test/warehouse/indexeddb_test.cljs#L309.
I am running more cases in single test. After each case I run
done-single function that when called last time, calls
Mocha (js test framework I've tried to imitate in this case) works in similar way: https://mochajs.org/#dynamically-generating-tests
(also, the fact that I’m not finding literature on the subject makes me think that it’s either obvious or obviously a bad idea)
yup, that is what I’m counting on (I should have said programmatically rather than dynamically). Anyway, I think I’m getting somewhere 🙂
I'm working on a cljs app that has a dependency that is my own local utils lib in a
.cljc file. I want to be able to make changes in the utils lib while working on my cljs app. So instead of adding it as a dependency in
deps.edn, I symlinked it into the
src directory. It works in the sense that I can use the lib, but if I change something in the utils.cljc file I can't see the changes in my cljs app's namespace. And I can't seem to just evaluate (with CIDER) the
utils.cljc file/namespace at all. Anybody know what's wrong, and how I can make it work?
in CIDER you can use
sesman-link-with-X where X is buffer, directory, project. Should let you link the two
I used that before, but the symlink was my attempt to make the utils lib act as part of the app so that it would reload just like the app code.
I’m not sure. When I used shadow-cljs + deps.edn + local roots, my code does reload