shadow-cljs icon indicating copy to clipboard operation
shadow-cljs copied to clipboard

Ignoring tests on production builds

Open sirmspencer opened this issue 1 year ago • 1 comments

We are considering colocating unit tests with the functions that they test (same file instead of a /test directory). During a production build those tests would need to be ignored in the output. Do you know if this is the case, or if that would be a new feature?

sirmspencer avatar Jul 25 '24 16:07 sirmspencer

By default tests are not included in release builds, except of course for test targets. However, this only really counts the tests (e.g. deftest) themselves, not their "supporting" code. So, I really wouldn't recommend colocating tests in the same file. It is possible and it is probable that :advanced eliminates all unneeded code, but I wouldn't want to rely on that personally.

thheller avatar Jul 25 '24 17:07 thheller