elm-testable versus testing a lower-level function

35 views
Skip to first unread message

Andrew Bruce

unread,
Oct 20, 2016, 5:25:07 PM10/20/16
to Elm Discuss
I'm new to Elm, and have been playing with test methodologies.

I'm wondering what the arguments for using elm-testable are, as opposed to testing something that returned a `(Model, Maybe Cmd)`, for example.
I've dodged using elm-testable by having a mapping from a testable function that produces a `(Maybe Msg)` to `(Cmd Msg)`. Obviously this mapping isn't itself testable, but I can live with that. Am I missing something that's about to bite me?


But this, which calls the the above, isn't, because it produces `Cmd` values that can't be easily asserted against in test: https://github.com/camelpunch/rascal-elm/blob/a8a5b064a76f360da6dd63b5e1b0b3a479d66948/src/Update.elm#L14 - but it's a fairly trivial mapping.

In general I'd prefer to update my own wrapper around Elm's changing API rather than elm-testable's, as I don't trust a nominally 'third party' library to stay in sync with Elm. Am I being paranoid? Perhaps there's a plan to make Elm's types more test-friendly?

P.S. Hi Aaron! This is some cool stuff you're working on.
Reply all
Reply to author
Forward
0 new messages