Skip to content
This repository was archived by the owner on Oct 9, 2019. It is now read-only.

Alternative (safer) Test.Runner API? #179

@kofigumbs

Description

@kofigumbs

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 formatLabel as discussed above (aka, don't expose labels : List String)
  • add a wrapper : (() -> List Expectation) -> () -> List Expectation param so that node-test-runner can catch exceptions

Test.Runner is currently labeled as "experts only" module, but I don't think it has to be!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions