It looks like the issue you're encountering is related to the types of the `Exit` values you're c...

I have a failing effect test, used to be passing but updating deps maybe things changed. I havent figured out what i'm doing wrong. The point of this test is to cause a failure and make sure the failure is handled.

it.effect('should return error', () =>
  Effect.gen(function* () {
    const { getTokens } = yield* Tokens;
    const result = yield* getTokens({ cookie: '12345' }).pipe(Effect.flip, Effect.exit);

    expect(result).toEqual(Exit.fail(HttpError.unauthorized()));
  }).pipe(Effect.provide(Layer.provideMerge(mockTokens, mockRequest))),
);


So my understanding (been a minute) is that if I flip this, then exit i would essentially be in the error path (assuming the function is going to be in the success channel otherwise).

My expect however is not correct.

const result: Exit.Exit<HttpError.HttpError, TokenResponseBody>


My result looks wrong I guess?

    const failure = Exit.fail(HttpError.unauthorized());

has type
const failure: Exit.Exit<never, HttpError.HttpError>


So basically I see this:

const failure: Exit.Exit<never, HttpError.HttpError>
const result: Exit.Exit<HttpError.HttpError, TokenResponseBody>


What am I doing wrong?
Was this page helpful?