DEV Community

Discussion on: Make tests a part of your app

 
sobolevn profile image
Nikita Sobolev

Oh, I see.

The technique you described later on in the article seems to work properly only with pure functions

It reallly depends, because returns expects you to separate pure code from impure. But, when testing laws with IO, it is expected to work with impure code.

This is also the case with deal. It even has its own notation for impure code: deal.readthedocs.io/basic/side-eff...

For both libs you can set your state for impure code before the actual test. So, it should work correctly.