How to test the complete update cycle

48 views
Skip to first unread message

Austin Bingham

unread,
Oct 20, 2016, 4:46:57 AM10/20/16
to Elm Discuss
This has been discussed a bit before, I think, but I couldn't find any real solution. I'm trying to understand how to test my update function, and in particular how to test it when one call may produce new Cmds which I also want to process.

It seems simple enough to test a single call to update: just pass in a Msg and a Model and check the Model that's returned. Ideally, though, I'd like to be able to a) check the msgs in the resulting Cmd and b) route those messages through update as well. It seems that if I can do (a) then I could do (b) straightforwardly.

Is there a way to do this? Even if I can't explicitly inspect the contents of the Cmd, is there a way to "route" that Cmd back to my update function?
Reply all
Reply to author
Forward
0 new messages