elm-test icon indicating copy to clipboard operation
elm-test copied to clipboard

test Task

Open maiermic opened this issue 8 years ago • 4 comments

I'd like to test a Task. Is this already possible?

maiermic avatar Oct 13 '15 08:10 maiermic

No, it’s not possible right now. This will require some planning, I think, since Tasks can perform effects. Are you thinking more like having a Task x a, performing it, and making assertions against the ultimate result, or are you thinking more along the lines of testing its actual effect? ​

On Tue, Oct 13, 2015 at 4:17 PM, Michael Maier [email protected] wrote:

I'd like to test a Task. Is this already possible?

— Reply to this email directly or view it on GitHub https://github.com/deadfoxygrandpa/Elm-Test/issues/26.

deadfoxygrandpa avatar Oct 13 '15 08:10 deadfoxygrandpa

I work on a native package that uses Tasks to calculate the result of asynchronous functions. I'm mainly interested in making assertions against the ultimate result. But I also like to test if errors (effects) appear as expected.

maiermic avatar Oct 13 '15 11:10 maiermic

This is something I'd like to add in the medium term. I'm not yet sure of the best way to go about it, I have some ideas, but it will surely involve adding Native code, which is a somewhat significant amount of work.

deadfoxygrandpa avatar Oct 19 '15 13:10 deadfoxygrandpa

I would love to see this feature! Tasks are the hardest part of Elm to debug. You can't evaluate them at the REPL or in test suites rn :cry:

langston-barrett avatar Apr 15 '16 01:04 langston-barrett