benansell/lobo-elm-test-extra/1.0.1

NOTE: this package is not compatible with Elm 0.19.1

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"




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

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

Further information on using lobo can be found here

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

  • concat -> instead use describe
  • filter -> instead use skip

Extra

focus : Test -> Test

Restrict the running of tests to only those that have focus: unfocused tests.

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

This will cause the lobo runner to ignore all other tests that don't have focus applied. focus can be applied to the following:

  • test
  • describe
  • fuzz, fuzzWith, fuzz2, fuzz3, fuzz4, fuzz5

Focus cannot be used to force a skipped test to run.

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 =
Test

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

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

A test that evaluates an expectation. 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

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

Fuzzer a
-> Fuzzer b
-> Fuzzer c
-> Fuzzer d
-> String
-> (a -> b -> c -> d -> Expectation)
-> Test

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

Fuzzer a
-> Fuzzer b
-> Fuzzer c
-> Fuzzer d
-> Fuzzer e
-> String
-> (a -> b -> c -> d -> e -> Expectation)
-> Test

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

fuzzWith : 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