Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check through Aff #44

Open
dakom opened this issue Aug 26, 2018 · 1 comment
Open

Check through Aff #44

dakom opened this issue Aug 26, 2018 · 1 comment

Comments

@dakom
Copy link

dakom commented Aug 26, 2018

This is more a question than an issue. Apologies if this is the wrong place to ask!

How do you test a functor which can only get its value after some time - i.e. say I can get it either by supplying a callback, or getting an Aff?

In other words, I believe I need to define Eq for the tests, but Eq is synchronous - how can I do it async?

@garyb
Copy link
Member

garyb commented Sep 2, 2018

I think in Haskell there's a Monadic module or something that supports testing effectful code, we'd probably need something like that to make a version of the law tests that can work for the kind of thing you're describing.

I'm not too sure really - when it comes to testing effectul code I tend to write unit tests instead, as unless the effects are benign, or based on State or some other kind of deterministic effect, the test will be relying on a bit more than just the property holding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants