This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-10
Channels
- # announcements (1)
- # asami (36)
- # babashka-sci-dev (5)
- # beginners (4)
- # calva (10)
- # chlorine-clover (2)
- # clj-commons (2)
- # clojure (35)
- # clojure-android (1)
- # clojure-norway (1)
- # clojurescript (11)
- # cursive (8)
- # deps-new (5)
- # emacs (8)
- # fulcro (11)
- # graalvm (15)
- # gratitude (5)
- # holy-lambda (11)
- # jobs-discuss (5)
- # lsp (9)
- # off-topic (9)
- # other-languages (2)
- # pathom (6)
- # polylith (43)
- # portal (35)
- # quil (6)
- # react (13)
- # reclojure (3)
- # releases (5)
- # rewrite-clj (13)
- # shadow-cljs (32)
When async tests fail, testing
messages are not printed. Is that expected, is there any solution?
Unsure whether it is about shadow or CLJS itself.
it seems the testing stuff is done in a try/finally which kind of assumes sync testing probably
no clue. if you setup an example showing it working with regular CLJS I will investigate 😛
instead it could maybe done using the test blocks thing with functions that are picked up from the queue
Cljs.test generally has poor support for async
Which is unfortunate, given that almost everything interesting in JS is asynchronous
Oh yeah, it seems to be implemented in a try-catch
so it wouldn't work in an async setup.
Which is a tad weird since async examples do use testing
: https://clojurescript.org/tools/testing
That's why I thought there might be something off with Shadow's test runner
FWIW this is one reason why I'm switching to Jest (cljs.test has a weak design and is effectively maintained)
I added selective test running once to cljs.test and it required monkey patching
that really has little to do with cljs.test
. :node-test
can do selective test runs just fine
cljs.test
isn't great overall I'd agree on that but the basics are fine. All the macros really are the problem
shadow.test
fixes that and beyond that there is just some UI that needs to be written to get the fancy stuff
Yes we're using shadow.test for that now, much better than my macguyver solution
ok, I can see from the code already that this isn't going to work async, but here is a repro:
$ plk
ClojureScript 1.10.597
cljs.user=> (require '[clojure.test :as t])
nil
cljs.user=> (t/deftest foobar (t/async done (t/testing "dude" (js/setTimeout (fn [] (t/is (= 3 4)) (done)) 1000))))
#'cljs.user/foobar
cljs.user=> (foobar)
1
FAIL in (foobar) (:)
expected: (= 3 4)
actual: (not (= 3 4))
cljs.user=> (t/deftest foobar (t/testing "dude" (t/is (= 3 4))))
#'cljs.user/foobar
cljs.user=> (foobar)
FAIL in (foobar) (file:44:173)
dude
expected: (= 3 4)
actual: (not (= 3 4))
the try/finally
just isn't going to work with async, the finally block is of course executed too early
Yep, same conclusion!
What you can of course do is move the testing
into the callback, but then it won't nest properly
When using the Inspect Stream window, is there a way to get the path to the current object within its context?
@alex.sheluchin no, not that simple. it'll use datafy/nav so constructing a "path" may not always be that reliable. also the UI navigates by index so it never knows actual path values
Thanks @U05224H0W. Not so complicated to figure out the path manually. Was just wondering if there was a shortcut.
Hey I tried to bump to version 2.15.11
from 2.15.10
and my project and tests started to throwing this https://github.com/rafaeldelboni/stasis/runs/3852914797?check_suite_focus=true:
Chrome Headless 94.0.4606.0 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_markdown$lib$react_markdown'
Chrome Headless 94.0.4606.0 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_markdown$index'
Chrome Headless 94.0.4606.0 (Linux x86_64) ERROR
Uncaught ReferenceError: babelHelpers is not defined
at ci.js:116796:9
ReferenceError: babelHelpers is not defined
at Object.shadow$provide.module$node_modules$react_markdown$lib$react_markdown (ci.js:188082:442)
at shadow.js.jsRequire (ci.js:116793:18)
at Object.shadow$provide.module$node_modules$react_markdown$index (ci.js:188088:300)
at Object.shadow.js.jsRequire (ci.js:116793:18)
at Object.shadow.js.require (ci.js:116818:20)
at ci.js:188249:56
Is there anything new I need to do in the new version? This only happens after I bump to the new version and delete the folder .shadow-cljs
@rafaeldelboni oops, should be fixed in 2.15.12. there was some compiled code from a branch in that release that shouldn't have been.
Thanks for your fast reply! :)
continuous delivery ftw!
Is deps.edn
the only way to pull in a dependency from a git repository when using shadow-cljs at the moment? Or is there a way to specify git deps in shadow-cljs.edn
?
If you're on lein, there's https://github.com/reifyhealth/lein-git-down I also don't think there's anything stopping sometime from putting it in a package json and adding it to to your paths. Not very elegant, but could work.