Unexpected Behavior in `Effect.flip()`: Success Channel Raises Error Instead of Returning Undefined

I do not know whether this is the expected behavior or there is an issue with my configuration but:
When using Effect.flip() in a test, if the output of the tested effect is the success channel instead of the failure one it will raise an error.

For example:
const result = yield* Effect.flip(
  Effect.gen(function* () {
    return yield* Effect.void;
  }),
);

Returns:
Error: An error has occurred

Imho, this is not very developer friendly.
I feel like it should actually return undefined so that the failure is raised by the assertion:
e.g.
AssertionError: expected undefined to be an instance of Error

Did I miss something ? 🤔
Was this page helpful?