Warn when a test contains no assertions
A warning should be printed when a test is run and there were no assertions (i.e. uses of is
) made during that test. E.g. if there were a test like so:
(deftest test-foo
(= 1 1))
Then when I run the test suite, a warning like "WARNING: test-foo made no assertions" should be printed. Clojure doesn't do this, but it would help catch some cases where the user forgot to use is
.
One way to implement this would be in test/run-all-tests
, by adding up (+ (*_cloje-test-passes*) (*_cloje-test-fails*) (*_cloje-test-errors*))
before and after each test is run. If the sum is the same before and after the test, that means no assertions were made during the test.