mpizenberg / elm-test-runner / ElmTestRunner.Result

Types and functions to manipulate a test result.

Manipulation of the result of a test run


type TestResult
    = Passed ({ labels : List String, duration : Basics.Float, logs : List String, distributionReports : List Test.Distribution.DistributionReport })
    | Failed ({ labels : List String, duration : Basics.Float, logs : List String, todos : List String, failures : List ElmTestRunner.Failure.Failure, distributionReports : List Test.Distribution.DistributionReport })

Type summarizing the results of a test run. It is obtained from the list of expectations returned by calling runner.run ().

fromExpectations : List String -> List Expectation -> TestResult

Convert a list of expectations (results of a run) into a TestResult. Return the Failed variant if there is any todo or failure in the expectations.

setDuration : Basics.Float -> TestResult -> TestResult

Set the duration that the test took.

setLogs : List String -> TestResult -> TestResult

Set the logs received for that test.

encode : TestResult -> Json.Decode.Value

Encode a TestResult.

decoder : Json.Decode.Decoder TestResult

Decode a TestResult.

Helper functions


type alias Summary =
{ totalDuration : Basics.Float
, passedCount : Basics.Int
, failedCount : Basics.Int
, todoCount : Basics.Int 
}

Quantitative summary of all test results.

summary : Array TestResult -> Summary

Report a quantitative summary of test results.