raduw
raduw

Reputation: 1098

(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)?

Upvotes: 3

Views: 346

Answers (1)

Alex Ott
Alex Ott

Reputation: 87144

Did you try to add the src into list of :test-paths in project definition?

Upvotes: 3

Related Questions