Writing Tests for Async Code using Effect
Hey everyone, I'm trying to understand how to best write tests for async code using effect. Wondering if anyone has some input
I have a simple db-call for a card that looks like this:
In my test I want to test the case where the database call fails, but can't seem to the the error type from the function when using Effect.runPromise
I am probably misunderstanding something here, but wouldn't a return type like an Either be more suitable for something like this? Or do we just have to accept that once we try to get values out of effects, we don't have typed errors anymore?
I have a simple db-call for a card that looks like this:
In my test I want to test the case where the database call fails, but can't seem to the the error type from the function when using Effect.runPromise
I am probably misunderstanding something here, but wouldn't a return type like an Either be more suitable for something like this? Or do we just have to accept that once we try to get values out of effects, we don't have typed errors anymore?
