How to properly discover tests in VSCode?
I've noticed the tests appear in the VSCode testing menu after I manually run them for the first time. Is there a way to make it discover all the tests beforehand?
Is this the issue you're having, and does the proposed fix there solve it? https://calva.io/test-runner/#tests-are-not-found
If not, @marcomorain might be able to provide more info since he implemented that feature.
I'm running a Leiningen project with :test-paths ["test"] in the defproject.
To clarify: The tests are shown in the VSCode interface. But, I get the message ; No tests found. 😱, ns: 0, vars: 0 in the REPL if I run them. The same happens if I choose to run all tests, tests from namespace or current test.
I can't reproduce. I tried with a Lein project with my tests path in :test-paths. My steps:
- Jacked in
- Loaded the file with the tests in it
- Ran the command to run all tests
Are you starting your repl with jack-in? If you aren't, then the issue may be that your repl doesn't have the required dependency (cider-nrepl) to run the tests. You can see what Calva adds to the repl in the jack-in command when you jack-in, and you can also run the command for copying the jack-in command to the clipboard and then paste it to start your repl, if you want to start it manually and connect.
Well, if your repl were missing cider-nrepl, you should see this message when you try to run tests (unless maybe you're on an old version of Calva):
; The server does not recognize or cannot perform the 'test-var-query' operation
In any case, what version of Calva are you using?
If cider-nrepl missing isn't the issue, then if you can provide a simple repo that I can use to reproduce the issue, that would be helpful.