MCPcopy Create free account
hub / github.com/Effect-TS/effect / succeed

Method succeed

packages/effect/src/testing/TestSchema.ts:503–516  ·  view source on GitHub ↗
(
    this: Encoding<S>,
    input: unknown,
    expected?: S["Encoded"]
  )

Source from the content-addressed store, hash-verified

501 expected: S["Encoded"]
502 ): Promise<void>
503 async succeed<S extends Schema.ConstraintEncoder<unknown, never>>(
504 this: Encoding<S>,
505 input: unknown,
506 expected?: S["Encoded"]
507 ) {
508 const r = await Effect.runPromise(
509 this.encodeUnknownEffect(input, this.options?.parseOptions).pipe(
510 Effect.mapErrorEager(SchemaIssue.defaultFormatter),
511 Effect.result
512 )
513 )
514 expected = arguments.length === 1 ? input : expected
515 assert.deepStrictEqual(r, Result.succeed(expected))
516 }
517 /**
518 * Asserts that encoding `input` fails and the stringified issue equals
519 * `message`.

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected