July 2019
Intermediate to advanced
310 pages
7h 26m
English
Now that you’re familiar with elm-test, let’s explore its API further. So far, you’ve used the simple Expect.equal expectation. The Expect module has other expectations such as Expect.notEqual, Expect.lessThan, and Expect.greaterThan when a simple Expect.equal doesn’t cut it. As you might imagine, an expectation such as Expect.greaterThan would expect the second argument (value to the left of the pipe operator) to be greater than the first argument. Look at this example to see what I mean.
| | describe "greaterThan" |
| | [ test "expects second argument to be greater than first" <| |
| | \_ -> 42 |> Expect.greaterThan 41 |
| | ] |
You can see more examples on the Expect module’s documentation page.[32]
In this ...
Read now
Unlock full access