elm-explorations / test

Write unit and fuzz tests for Elm code.
https://package.elm-lang.org/packages/elm-explorations/test/latest
BSD 3-Clause "New" or "Revised" License
237 stars 39 forks source link

Display number of skipped tests #161

Open ad-si opened 3 years ago

ad-si commented 3 years ago

Currently it does not say how many tests were skipped:

Running 148 tests. To reproduce these results, run: elm-test --fuzz 100 --seed 132114825190419

TEST RUN INCOMPLETE because Test.skip was used

Duration: 388 ms
Passed:   148
Failed:   0
ad-si commented 3 years ago

Oh, I guess this is the wrong repository. Also opened the issue in the test runner repo: https://github.com/rtfeldman/node-test-runner/issues/492 Feel free to close it here…

mpizenberg commented 3 years ago

This behavior is due to the output of the fromTest function in elm-explorations/test. It would require a change there to also pass the result of countAllRunnables distribution.skipped to the Skipping custom type variant. So this is actually an issue relevent both for node-test-runner and this repo.

harrysarson commented 3 years ago

The fix is probably to change the Skipping constructor here to be:


 type SeededRunners
     = Plain (List Runner)
     | Only (List Runner)
-    | Skipping (List Runner)
+    | Skipping { skipped: Int, tests: (List Runner) }
     | Invalid String

and then follow the compiler errors. I think a PR is welcome although this would be a major change so won't be released until elm-explorations/test 2.0.0 ships which would be a while into the future.