(clojure testing) 配置 leiningen 到 src 里面的 运行 tests (不仅仅在 test 目录)

(clojure testing) Configure leiningen to run tests inside src (not only in the test directory)

在编写测试时,我喜欢使用用 deftest 定义并放在测试目录中的测试,以及用 with-test 定义并放在 src 目录中函数定义旁边的测试。

我使用 deftest 进行需要复杂设置的测试,并且在被测函数旁边定义会非常混乱。

我使用 with-test 来测试具有简单输入参数的函数。

我能够 运行 通过 运行 宁 (run-tests) 宏在源代码中定义的测试。

我 运行 deftest 测试 lein test

有没有办法配置 lein test 来获取 src 目录中的所有测试(with-test 测试)?

您是否尝试将 src 添加到项目定义中的 :test-paths 列表中?