Is it possible to use #dbg/#break with the calva test runner?
I’m using “Calva: run current test” and it seems to be ignoring them
Also I think ‘expected’ and ‘actual’ have been flipped, this is what I get when I run lein test:
and this in calva output:
last question 😅 should “Calva: Interrupt Running Evaluations” stop the test runner? It doesn’t seem to. Happy to add Github issues for any of these if that would help 🙂
@tomisme The test runner loads the current file when you "run current test" (and maybe the other test commands too) to make sure the latest version of the code is run. When the file is loaded, breakpoints are essentially removed. See here: https://calva.io/debugger/#loading-the-file-and-eval-on-save. So no, breakpoints will not be hit when running tests via the runner.
I think a note in the docs would be helpful about that.
That test output looks correct though, the expected
is the first arg to the =
function, so you expect status
(`500`) to equal 403
Lein is saying you expected status to equal 403, but actually 500 (expected) does not equal 403
Flipping your args to =
may read better. But the test reporter uses expected
and actual
as reported from cider-nrepl.
Also, regarding the breakpoints, you can eval the test form with breakpoint tags, then call it directly (avoiding a load file in between), and the breakpoint will be hit
I added a note to the docs about this: https://calva.io/debugger/#my-breakpoint-in-a-test-isnt-being-hit