简体   繁体   中英

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

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM