benansell / lobo-elm-test-extra / ElmTest.Extra

Additions to elm-test for use with the lobo test runner.

skippedTest : Test
skippedTest =
    skip "ignore test" <|
        test "skippedTest" <|
            \() ->
                Expect.fail "Never runs"

Migration from elm-test

To use this package you will need to use lobo with the "elm-test-extra" framework, and replace:

import Test

with

import ElmTest.Extra

It is recommended that you give each describe / test a meaningful description. However, lobo does not enforce any uniqueness constraints on these descriptions.

Further information on using lobo can be found here

The following elm-test functions are not available in elm-test-extra:

Extra

skip : String -> Test -> Test

Prevent the running of tests with a reason for them to be skipped.

skippedTest : Test
skippedTest =
    skip "ignore test" <|
        test "skippedTest" <|
            \() ->
                Expect.fail "Never runs"

This will cause the lobo runner to skip this test. For further help see elm-test documentation

elm-test

lobo compatible declarations of the elm-test Test API. In the first instance please see the original elm-test documentation


type alias Test =
ElmTest.Runner.Test

A test which has yet to be evaluated. For further help see the original elm-test documentation

only : Test -> Test

Restrict the running of tests to only those that have only:

onlyTest : Test
onlyTest =
    only <|
        test "Example passing test" <|
            \() ->
                Expect.pass

This will cause the lobo runner to ignore all other tests that don't have only applied. Only cannot be used to force a skipped test to run. For further help see elm-test documentation

test : String -> (() -> Expectation) -> Test

A test that evaluates an expectation. For further help see the original elm-test documentation

todo : String -> Test

A temporary placeholder for a test that always fails. For further help see the original elm-test documentation

Organizing Tests

describe : String -> List Test -> Test

Group a set of tests with a description. For further help see the original elm-test documentation

Fuzz Testing

fuzz : Fuzzer a -> String -> (a -> Expectation) -> Test

Run a test with random input provided by the fuzzer. For further help see the original elm-test documentation

fuzz2 : Fuzzer a -> Fuzzer b -> String -> (a -> b -> Expectation) -> Test

Run a test with 2 random inputs provided by the fuzzers. For further help see the original elm-test documentation

fuzz3 : Fuzzer a -> Fuzzer b -> Fuzzer c -> String -> (a -> b -> c -> Expectation) -> Test

Run a test with 3 random inputs provided by the fuzzers. For further help see the original elm-test documentation

fuzzWith : Test.FuzzOptions -> Fuzzer a -> String -> (a -> Expectation) -> Test

Run a test with random input provide by a fuzzer using the supplied options. For further help see the original elm-test documentation