1

I'd like to debug my test when it is run by CIDER:

(let [test-system (atom (new-test-system))]
 (some-setup-code)
 (deftest my-test
   ;uses test-system in here)

As you see, my tests are wrapped in a let, which gets debugged as normal: I can hit c to move through the forms until it gets to the deftest, then the debugger quits, and my-test is highlighted in red, ready to be debugged when run.

When I run the test with , t t it doesn't debug, it passes as normal. I expected it to break and let me debug inside the test.

What am I doing wrong? I'm rather new to CIDER.

0atman
  • 3,298
  • 4
  • 30
  • 46

1 Answers1

1

I'm facing a similar issue.

Even if I instrument a function that is called from within the deftest I can't debug it when I execute the test with , t t (cider-test-run-focused-test). It seems that this action clears out the instrumentation.

If I run the test manually via (clojure.test/run-tests) (switching to the namespace before e.g. via cider-repl-set-ns) I can debug both tests and auxiliary functions without problems.

Juraj Martinka
  • 3,991
  • 2
  • 23
  • 25