jgrenat / elm-html-test-runner / Test.Runner.Html

This library aims to run and display tests as HTML on a web page, for example in order to create code kata.

One limitation to that is that you need to add your test dependencies as project dependencies.

Definition


type Config

Config object used to define options like the fuzz count, the initial seed, whether or not the passed tests should be displayed...

Display tests results

viewResults : Config -> Test -> Html a

Run and display test results

viewResults myConfig myTests

Configuration

defaultConfig : Random.Seed -> Config

Create a default config, initializing it with an initial seed used for fuzz testing.

Random.initialSeed 10000 |> defaultConfig

withFuzzCount : Basics.Int -> Config -> Config

Set the fuzz count in the Config. Should not be useful if you don't use fuzz testing.

Random.initialSeed 10000 |> defaultConfig |> withFuzzCount 50

showPassedTests : Config -> Config

Indicates that the resulting HTML should show passed tests. This is the default behavior.

Random.initialSeed 10000 |> defaultConfig |> showPassedTests

hidePassedTests : Config -> Config

Indicates that the resulting HTML should NOT show passed tests.

Random.initialSeed 10000 |> defaultConfig |> hidePassedTests