我想在 CIDER 运行时调试我的测试:
(let [test-system (atom (new-test-system))]
(some-setup-code)
(deftest my-test
;uses test-system in here)
如您所见,我的测试被包装在一个 let
中,它被正常调试:我可以点击 c
在表单中移动,直到它到达 deftest
,然后调试器退出,my-test
以红色高亮显示,准备运行时进行调试。
当我使用 , t t
运行测试时,它没有调试,而是正常通过。我预计它会中断并让我在测试中进行调试。
我做错了什么?我是 CIDER 的新手。
最佳答案
我遇到了类似的问题。
即使我检测从 deftest
中调用的函数,当我使用 , t t
(cider-测试运行重点测试
)。
看来这个 Action 清除了仪器。
如果我通过 (clojure.test/run-tests)
手动运行测试(在例如通过 cider-repl-set-ns
之前切换到 namespace )我可以毫无问题地调试测试和辅助功能。
关于testing - 在 deftest 中使用 cider 调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53870654/