reagent

김태희(taehee kim) 2024-03-04T13:15:46.098189Z

Hello. I'm trying to build a component testing environment. Here are the requirements I want, and things I've tried. • out team have a shadow-cljs + reagent project. • render reagent component • in real browser (no jsdom, happy-dom) • with @testing-library/user-event and promise • reliable watch mode! run tests on file save. (without manually evaluate (run-all-tests)

김태희(taehee kim) 2024-03-04T13:15:59.166719Z

1. shadow cljs :target :browser-test a. i can't find the way to "run tests on file save" 2. karma! a. https://github.com/karma-runner/karma/?tab=readme-ov-file#karma-is-deprecated-and-is-not-accepting-new-features-or-general-bug-fixes 3. jest-cljs a. i want real browser 4. vitest browser mode + @testing-library/jest-dom a. how can i import cljs component and reagent from vite project? 5. https://github.com/lambdaisland/kaocha-cljs2/blob/main/doc/cljdoc.edn a. https://github.com/lambdaisland/kaocha-cljs2/issues/2

p-himik 2024-03-04T13:19:24.924869Z

> i can't find the way to "run tests on file save" If you open the test web page generated by shadow-cljs itself, there will be hot reloading buit-in. Should also work with your own page if it runs tests on load or on hot reload (which can be done with a shadow-cljs hook).

👀 1
p-himik 2024-03-04T13:20:39.896519Z

it's watch mode runs before shadow-cljs hot reloadProbably because you have set it to watch the CLJS files. Instead, it should watch the compiled JS files.

👀 1
김태희(taehee kim) 2024-03-04T13:25:48.920799Z

Thank you for quick response. It's a good idea to look up the shadow-cljs hook documentation. When I looked up kaocha's document, kaocha watches the dependencies of source codes and namespaces (not the compiled results. it is initially built for clojure not cljs)

김태희(taehee kim) 2024-03-04T13:26:11.969599Z

Can you recommend me an existing example repository or something?

p-himik 2024-03-04T13:27:10.756809Z

Alas, no - I don't test the components themselves.

🥲 1