avh4 / elm-testable

Makes Cmds and Tasks testable
http://package.elm-lang.org/packages/avh4/elm-testable/latest
41 stars 5 forks source link

Cannot use this with ports #2

Open rogeriochaves opened 8 years ago

rogeriochaves commented 8 years ago

Hello, this is an awesome package, unfortunately I can't use this because I have outgoing ports, and ports can only return Cmd a or Sub a, using Testable.Cmd.Cmd a throws an error:

port requestDownloadHead : HeadHash -> Testable.Cmd.Cmd a
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You are saying it should be:

    Account.Model.HeadHash -> Testable.Cmd.Cmd a

But you need to use the particular format described here:
<http://guide.elm-lang.org/effect_managers/>

And although I don't need elm-testable to test outgoing ports (because I can do like this), I want to mix Cmds for ports and tasks and still be able to test them.

My suggestion would be to add an extra type for Testable.Cmd, like PortCmd

rogeriochaves commented 8 years ago

I've created a PR for this: #3