-
Notifications
You must be signed in to change notification settings - Fork 35
Alternative (safer) Test.Runner API? #179
Description
TLDR: Test.Runner.Exploration
Test.Runner has a fairly "query-driven" module which doesn't enforce some of the rules that Test discusses. Here are a couple example:
[
todo] tests always fail, but test runners will only include them in their output if there are no other failures.
[
skip] your entire test suite will fail, even if each of the individual tests pass
Rules like this could enforced internally to elm-test, which would simplify and protect call sites.
Additionally, an alternative API could let simplify the labeling by enforcing that formatLabels is actually used.
formatFailures : { label : String -> a, error : String -> a } -> Runner -> List (List a)
I suspect an API change could simplify some elm-test internals as well, but I haven't looked through this code base.
I've started to incorporate some of these concerns in html-test-runner's Test.Runner.Exploration.
It's mostly to serve as a discussion point, since there are some obvious changes that need to happen:
- pull in
formatLabelas discussed above (aka, don't exposelabels : List String) - add a
wrapper : (() -> List Expectation) -> () -> List Expectationparam so thatnode-test-runnercan catch exceptions
Test.Runner is currently labeled as "experts only" module, but I don't think it has to be!