marick / Midje

Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing
MIT License
1.68k stars 128 forks source link

Change clojure.test output order #412

Closed philomates closed 6 years ago

philomates commented 6 years ago

Midje has the ability to check clojure.test tests, and when it does, will include them in the test summary. The ordering of this summary is a bit unclear, because first midje checks normal midje facts, printing namespaces loaded (if configured to do so), then it outputs results from clojure.test tests, then it finally prints results of the midje facts.

The changes I'm proposing here will show the midje results first so they will appear with the fact namespaces loaded, and then show the clojure.test results.

I've also adapted the clojure.test results to show how many tests were run, which is currently not shown.

Before:

$ lein midje :autotest
...
= Namespace midje.emission.t-deprecation
= Namespace as-documentation.about-defrecord.using-refer--plain-tests.test
= Namespace midje.emission.plugins.t-default-failure-lines
>>> Output from clojure.test tests:
= Namespace behaviors.background-nesting.t-left-to-right
= Namespace behaviors.background-nesting.t-three-levels-outside
= Namespace implementation.line-numbers.fim-check-failures
= Namespace behaviors.background-nesting.t-three-levels
= Namespace behaviors.background-nesting.t-shadowing
= Namespace behaviors.background_nesting.t-background-command
= Namespace behaviors.background-nesting.t-outside
= Namespace behaviors.folded-prerequisites-and-namespaces.t-using-namespace
= Namespace behaviors.background-nesting.t-shadowing-outside-background

0 failures, 0 errors.
>>> Midje summary:
All checks (373) succeeded.
[Completed at 12:06:25]

After:

$ lein midje :autotest
...
= Namespace midje.emission.t-deprecation
= Namespace as-documentation.about-defrecord.using-refer--plain-tests.test
= Namespace midje.emission.plugins.t-default-failure-lines
>>> Midje summary:
All checks (373) succeeded.

>>> Output from clojure.test tests:
= Namespace behaviors.background-nesting.t-left-to-right
= Namespace behaviors.background-nesting.t-three-levels-outside
= Namespace implementation.line-numbers.fim-check-failures
= Namespace behaviors.background-nesting.t-three-levels
= Namespace behaviors.background-nesting.t-shadowing
= Namespace behaviors.background_nesting.t-background-command
= Namespace behaviors.background-nesting.t-outside
= Namespace behaviors.folded-prerequisites-and-namespaces.t-using-namespace
= Namespace behaviors.background-nesting.t-shadowing-outside-background

Ran 34 tests containing 32 assertions.
0 failures, 0 errors.
[Completed at 12:06:25]