cognitect / transit-cljs

Transit for ClojureScript
http://transit-format.org
Apache License 2.0
323 stars 20 forks source link

Not all tests being run via lein #51

Closed mfikes closed 2 years ago

mfikes commented 5 years ago

If you do lein cljsbuild once test you will see:

Testing transit.test.core

Ran 10 tests containing 46 assertions.

The run-tests macro is sitting in -main that is too high up in the file, prematurely expanding to only the tests that have been defined at that point in the source:

https://github.com/cognitect/transit-cljs/blob/6d597134ab85003e73ce0b55a1c8a4154d3446de/test/transit/test/core.cljs#L161

If you move it down to just before (set! *main-cli-fn* -main) you will see all of the tests being run:

Testing transit.test.core

Ran 19 tests containing 58 assertions.