Fork me on GitHub
#shadow-cljs
<
2021-11-25
>
erwinrooijakkers16:11:40

I want to have a folder “src” and a folder “test” and then run tests via karma. I have specified :source-paths ["src" "test"], but when I run the tests via npx shadow-cljs compile ci && npm run karma (using setup in https://shadow-cljs.github.io/docs/UsersGuide.html#_the_build) it says 0 tests are found. If I move my test file to the “src” folder and I run the command the tests are found. Is there a way to have a separate test folder from where tests are picked up?

thheller16:11:12

do you actually use shadow-cljs.edn to manage your dependencies? or do you use deps.edn or project.clj?

erwinrooijakkers16:11:20

I use shadow-cljs.edn

thheller16:11:58

and the files are properly namespaced and match the regexp? ie. default namespaces ending in -test

erwinrooijakkers16:11:05

the namespace ends in -test, the file with _test

thheller16:11:09

and you did actually restart shadow-cljs after making that change?

erwinrooijakkers16:11:28

I rerun npx shadow-cljs compile ci && npm run karma

erwinrooijakkers16:11:35

maybe I can do a deeper clean?

thheller16:11:36

that doesn't imply restarting

thheller16:11:44

does it say "connected to server"?

thheller17:11:03

then you still have a server instance running with the old settings I guess

thheller17:11:07

need to restart that

erwinrooijakkers17:11:14

I stopped the server

erwinrooijakkers17:11:17

now it works 🙂

erwinrooijakkers17:11:20

okay thanks!! 😄

erwinrooijakkers17:11:29

swift reply and happy it works

Stephen Wiseman19:11:21

Real quick question: The docs mention that you can set the compiler option :infer-externs to :auto , which will trigger the compiler to warn about possible extern issues. However, in the compiler options section of the docs, it says that infer-externs defaults to true, which also seems to generate warning about possible extern issues. What’s the difference between :auto and true?

Stephen Wiseman19:11:28

My assumption is that :auto maybe does something extra to generate the appropriate externs (given a simple ^js typehint), and true does not. However, I can’t quite tell from the docs if this is a correct assumption.