arowM/elm-sequential-test/2.2.0

Test.Sequence

Sequencial testing.

type Sequence a

Represents sequence of tests with its result a.

run : String -> Sequence a -> Test
test : String -> (() -> Expectation) -> Sequence ()

Construct a new Sequence.

pass : a -> Sequence a

Sequence that always passes with specified value a.

fail : String -> (() -> Expectation) -> Sequence a

Sequence that always fails.

import Expect


someSequence
    |> andThen
        (\str ->
            case String.toInt str of
                Nothing ->
                    fail "Not an integer" <|
                        \() -> Expect.fail str
                Just n ->
                    pass n
        )
describe : String -> Sequence a -> Sequence a

Apply a description to the given sequence of tests.

map : (a -> b) -> Sequence a -> Sequence b
andThen : (a -> Sequence b) -> Sequence a -> Sequence b
assert : String -> (a -> Expectation) -> Sequence a -> Sequence a

Append a new expectation.

cases : (a -> List (Sequence ())) -> Sequence a -> Sequence ()
namedCases : (a -> List ( String, Sequence () )) -> Sequence a -> Sequence ()