calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
Tom H. 2020-10-13T06:55:02.294800Z

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

Tom H. 2020-10-13T06:55:40.295300Z

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

Tom H. 2020-10-13T07:13:07.296100Z

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

Tom H. 2020-10-13T07:13:10.296200Z

Tom H. 2020-10-13T07:13:37.296600Z

and this in calva output:

Tom H. 2020-10-13T07:13:40.296700Z

Tom H. 2020-10-13T08:18:10.299700Z

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 🙂

bringe 2020-10-13T17:35:24.304500Z

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

bringe 2020-10-13T17:35:41.305Z

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

bringe 2020-10-13T17:39:05.306400Z

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

bringe 2020-10-13T17:39:40.307Z

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

bringe 2020-10-13T17:45:53.307800Z

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

bringe 2020-10-13T17:49:37.308900Z

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

bringe 2020-10-13T18:11:39.309900Z

I added a note to the docs about this: https://calva.io/debugger/#my-breakpoint-in-a-test-isnt-being-hit