A collection of functions used by authors of test runners. To run your
own tests, you should use these runners; see the README for more information.
Convert a Test into a Runner.
In order to run any fuzz tests that the Test may have, it requires a default run count as well
as an initial Random.Pcg.Seed. 100 is a good run count. To obtain a good random seed, pass a
random 32-bit integer to Random.Pcg.initialSeed. You can obtain such an integer by running
Math.floor(Math.random()*0xFFFFFFFF) in Node. It's typically fine to hard-code this value into
your Elm code; it's easy and makes your tests reproducible.
A standard way to format descriptiona and test labels, to keep things consistent across test runner implementations.
The HTML, Node, String, and Log runners all use this.
What it does:
drop any labels that are empty strings
format the first label differently from the others
reverse the resulting list
[ "the actual test that failed" , "nested description failure" , "top-level description failure" ] |> formatLabels ((++) "↓ ") ((++) "✗ ")
{- [ "↓ top-level description failure" , "↓ nested description failure" , "✗ the actual test that failed" ] -}
A structured test runner, incorporating: