When writing tests I like to use both tests defined with deftest
and placed inside the test directory, and tests defined with with-test
and placed next to the function definition in the src directory.
I use deftest
for tests that require complicated setup and would be quite messy to define next to the function under test.
I use with-test
for testing functions with simple input parameters.
I am able to run the tests defined in the source by running the (run-tests)
macro.
I run the deftest
tests with lein test
.
Is there a way to configure lein test
to also pick up all the tests in the src directory (the with-test
tests)?
您是否尝试将src
添加到项目定义中的:test-paths
列表中?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.