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

Method succeed

packages/effect/src/testing/TestSchema.ts:363–376  ·  view source on GitHub ↗
(
    this: Decoding<S>,
    input: unknown,
    expected?: S["Type"]
  )

Source from the content-addressed store, hash-verified

361 expected: S["Type"]
362 ): Promise<void>
363 async succeed<S extends Schema.ConstraintDecoder<unknown, never>>(
364 this: Decoding<S>,
365 input: unknown,
366 expected?: S["Type"]
367 ) {
368 const r = await Effect.runPromise(
369 this.decodeUnknownEffect(input, this.options?.parseOptions).pipe(
370 Effect.mapErrorEager(SchemaIssue.defaultFormatter),
371 Effect.result
372 )
373 )
374 expected = arguments.length === 1 ? input : expected
375 assert.deepStrictEqual(r, Result.succeed(expected))
376 }
377 /**
378 * Asserts that decoding `input` fails and the stringified issue equals
379 * `message`.

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected