Testing with Signals - is it even possible?

74 views
Skip to first unread message

Jessica Kerr

unread,
Jul 31, 2015, 6:41:57 PM7/31/15
to Elm Discuss
I want to write some tests around code that deals with Signals.

For instance, I'd like to test a function that converts a one-time signal (containing several events) into a series of signals (each containing one event).
It had a bug in it (since fixed) that would have been lovely to catch in a property. "If I send in N events, I receive N event messages within (N*3 + a bit) seconds"

But ... how does one test with Signals? I could fake the input easily enough. But getting the output? How would one get, say, "All the messages that come in within 20 seconds" in order to compare them to others?

Jessica Kerr

unread,
Jul 31, 2015, 6:52:53 PM7/31/15
to Elm Discuss
Thanks Mike Clark for linking me too:  https://groups.google.com/forum/#!topic/elm-discuss/Kyuc-jpDJiY
How "Testing Signal-related code" didn't come up in a search for "test signal" ... Google, you are failing at groups >:-(

So thanks, @rgrempel, will reply there.
Reply all
Reply to author
Forward
0 new messages