This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-03
Channels
- # announcements (15)
- # babashka (143)
- # babashka-sci-dev (2)
- # beginners (35)
- # biff (11)
- # calva (5)
- # cider (8)
- # clerk (4)
- # clj-kondo (58)
- # cljdoc (6)
- # clojure (88)
- # clojure-denmark (1)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (16)
- # clojure-uk (1)
- # clojurescript (19)
- # clr (32)
- # code-reviews (158)
- # datahike (5)
- # datomic (10)
- # deps-new (3)
- # fulcro (12)
- # graalvm (20)
- # honeysql (23)
- # hyperfiddle (32)
- # kaocha (17)
- # membrane (6)
- # observability (1)
- # other-languages (2)
- # pathom (5)
- # practicalli (12)
- # reagent (4)
- # reitit (7)
- # releases (1)
- # sci (25)
- # shadow-cljs (52)
I wish I could opt out... I actually find it useful to have a map-like thing that also has the same JS properties as keys
If it's acceptable, should be somewhat easy to write a function that wraps an instance of a particular record in an object that lets you do that via descriptors.
But also feels like it's a reasonable feature request to have e.g. something like (defrecord R [^:export field])
supported.
I could hand a JS lib the result of (->Thing foo bar baz)
and in my tests assert that :foo
and :baz
are right given some operation
Not sure I follow. Where does JS come in? Do you test your CLJS code with some JS library, by writing assertions in JS?
two use cases
1. I am passing objects to a JS library that need to look like #js {:foo ,,, :bar ,,,}
2. I want to write tests on functions that generate large sequences of these objects
my CLJS tests could access the record using (:foo thing)
instead of (.-foo thing)
is all
Ah, so the actual need is reversed. cljs-bean
could help, but it would still be that wrapper.
@U05224H0W you mean I'd add externs for my record?
well the easiest version is https://shadow-cljs.github.io/docs/UsersGuide.html#_simplified_externs