Exposes a bunch of methods to run tests based on generated test data.
{ initialModel : String
, messages : List String
, expectedOutput : String
}
Test data to test a update
function
sandboxUpdate : { modelDecoder : Json.Decode.Decoder model, messageDecoder : Json.Decode.Decoder msg, update : msg -> model -> model } -> List UpdateFunctionTestData -> Test
Test the update
function of a sandbox
program, following the form msg -> model -> model
, then compare the
results to the saved results.
update : { modelDecoder : Json.Decode.Decoder model, messageDecoder : Json.Decode.Decoder msg, update : msg -> model -> ( model, Platform.Cmd.Cmd msg ) } -> List UpdateFunctionTestData -> Test
Test a regular update
function, following the form msg -> model -> (model, Cmd msg)
, then compare the
results to the saved results.
The command part is not tested, only the model is kept.