do you have React installed? older versions of reagent depended on react-cljsjs; new versions expect you to install React yourself, either by depending on react cljsjs in your app or via npm depending on your project setup
hiya - I created that issue, so ... I may be able to answer - I don't see an explicit react dependency
specifically, it has an :exclusions
for cljsjs/react
in your app?
well, in the recipe https://github.com/reagent-project/reagent-cookbook/blob/master/recipes/test-example-with-ReactTestUtils/project.clj#L4
I got something that at least got through to compiling the JS ...
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.773"]
[reagent "1.0.0"]
[cljsjs/react "15.6.1-1"]
;; [cljsjs/react-with-addons "15.6.1-0"]
[cljs-react-test "0.1.4-SNAPSHOT" :exclusions [cljsjs/react-with-addons]]
[prismatic/dommy "1.1.0"]]
but, it fails then ...
Error while loading file: "resources/public/js/compiled/test.js"
SyntaxError: resources/public/js/compiled/test.js:285:503 Expected an operand but found const
might be because I'm trying with nashorn since I haven't taken the time to setup karma/chrome-headless/etc.
setting that up right now to check ... be just a minute
In addition, I think cljs-react-test won't work with new versions of react / is no longer maintained. I am curious what is currently used by the community as a replacement.
was running in a Docker container, but setting all that up in there is a PITA ...
yeah - ultimately, I'm not trying to get something SPECIFIC to work ... I'm trying to write tests with reagent
... that's all - what's being used?
nobody testing?
@bdruth yeah, for sure, i am also interested in whatever the current testing practices are and would prefer replacing that recipe all together (since it is stale and now broken after the blind version updates to all the recipes)
yah
23 03 2021 23:17:21.242:WARN [web-server]: 404: /out/goog/deps.js
23 03 2021 23:17:21.268:WARN [web-server]: 404: /out/cljs_deps.js
Chrome Headless 89.0.4389.90 (Mac OS 11.2.2) ERROR
Uncaught TypeError: Cannot read property 'TestUtils' of undefined
at out/cljs_react_test/utils.js:79:48
TypeError: Cannot read property 'TestUtils' of undefined
at out/cljs_react_test/utils.js:79:48
Subprocess failed (exit code: 1)
we use react-testing-library at work
https://testing-library.com/docs/react-testing-library/intro/
but honestly I think a lot of teams eschew testing their front end outside of manual testing or browser automation
k, I'll take a look - also found https://francisvitullo.medium.com/a-way-of-testing-views-in-clojurescript-apps-98aaf57c5c2a
will take a deeper look tomorrow!
thx all 🙂
👍:skin-tone-2:
@bdruth @lilactown thanks! Regarding the recipe in question, I think for now I'll revert the version of reagent back and move it to the 'old recipes' section. I'll also add a note in the readme that new testing recipes are welcomed.