Testing a Specific Error in an Effect

I'm doing some unit test. I want to test the especific error out of the effect like this so far:
const result = await Effect.runPromiseExit(program);

expect(Exit.isFailure(result)).toBe(true);


How to I get the error (cause) from result??

There is a helper function in the efect repo but is not working

export const assertType =
  <A>() =>
  <B>(_: B): [A] extends [B] ? ([B] extends [A] ? true : false) : false =>
    void 0 as any;

export const satisfies = <T>(type: T) => type;

So I'm trying this
satisfies<true>(assertType<Exit.Exit<WifiOffloadError.BadRequest>>()(result));

Is not working
Was this page helpful?