You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property 'test' of undefined
when trying to "Run Tests for Current Namespace" in a non -test namespaces. This command's official docs state that:
Runs the tests for the current namespace. If not a -test namespace, tests for the current namespace plus its corresponding -test namespace will be run.
so it seems that non -test namespaces are indeed supported so I would expect the command worked instead of giving an error, especially if individual tests can be run using command "Run Current Test".
For instance, in the attached image you can see 2 test files core-test.clj & test-core.clj and the output in REPL for each file when first each test is run individually using "Run Current Test" and then all tests in namespace are run using "Run Tests for Current Namespace". As you can see, everything works fine for core-test namespace but we got the error in this issue when running "Run Tests for Current Namespace" in namespace test-core.
I understand that the convention is to write tests inside -test namespaces but based on the official docs and the fact that the tests in the namespace can be successfully run by evaluating (clojure.test/run-tests 'example.test-core) in the REPL, I do believe this is an issue.
The text was updated successfully, but these errors were encountered:
Also faced this today.
That worked smoothly before, apparently got broken between v2.0.226 (works) and v2.0.227 (doesn't).
Unfortunately my understanding of the inner workings of calva is not good enough to pinpoint the problem.
These changes related to the test runner were included in 2.0.227: #1405. I'm not sure if something in that PR is causing this but it seems to be the only change in that version directly related to the test runner.
I sort of see what's happening. When the command to run tests for a namespace is executed, if the current namespace does not end in -test it seems another namespace is set to have tests run for it that is the current namespace with -test appended to it.
In the below case, I ran the command in the test-core namespace. So then Calva tries to run tests for test-core and test-core-test. The latter namespace does not exist, but tests are attempted to be run for it and reported. During the reporting is where the error occurs, at this line:
You can see in the below screenshots that one of the results is an nrepl response with a namespace-not-found status, which I think leads to one of the summaries in totalSummary being undefined.
I got error:
when trying to "Run Tests for Current Namespace" in a non
-test
namespaces. This command's official docs state that:so it seems that non
-test
namespaces are indeed supported so I would expect the command worked instead of giving an error, especially if individual tests can be run using command "Run Current Test".For instance, in the attached image you can see 2 test files
core-test.clj
&test-core.clj
and the output in REPL for each file when first each test is run individually using "Run Current Test" and then all tests in namespace are run using "Run Tests for Current Namespace". As you can see, everything works fine forcore-test
namespace but we got the error in this issue when running "Run Tests for Current Namespace" in namespacetest-core
.I understand that the convention is to write tests inside
-test
namespaces but based on the official docs and the fact that the tests in the namespace can be successfully run by evaluating(clojure.test/run-tests 'example.test-core)
in the REPL, I do believe this is an issue.The text was updated successfully, but these errors were encountered: