Handling `ParseError` in Unit Tests for Schema Parsing

Hi! I try to write some unit tests, and want to handle the ParseError case:
it.effect.only('should pass', () =>
  Effect.gen(function* () {
    const MyStruct = Schema.Struct({ id: Schema.String })
    const valueToParse = {}

    expect(
      yield* Schema.decodeUnknown(MyStruct)(valueToParse).pipe(Effect.cause),
    ).toEqual(
      Cause.fail(
        ParseResult.parseError(
          new ParseResult.Type(MyStruct.ast, valueToParse),
        ),
      ),
    )
  }),
)

However, this code doesn't pass. It has slightly different format (see the screenshot). Don't you know how to make this test pass? Ideally, the actual value should remain intact, since I don't control it.
image.png
Was this page helpful?