Fork me on GitHub
#calva
<
2020-10-13
>
Tom H.06:10:02

Is it possible to use #dbg/#break with the calva test runner?

Tom H.06:10:40

I’m using “Calva: run current test” and it seems to be ignoring them

Tom H.07:10:07

Also I think ‘expected’ and ‘actual’ have been flipped, this is what I get when I run lein test:

Tom H.07:10:37

and this in calva output:

Tom H.08:10:10

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 🙂

bringe17:10:24

@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.

bringe17:10:41

I think a note in the docs would be helpful about that.

bringe17:10:05

That test output looks correct though, the expected is the first arg to the = function, so you expect status (`500`) to equal 403

bringe17:10:40

Lein is saying you expected status to equal 403, but actually 500 (expected) does not equal 403

bringe17:10:53

Flipping your args to = may read better. But the test reporter uses expected and actual as reported from cider-nrepl.

bringe17:10:37

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