MCPcopy
hub / github.com/Effect-TS/effect / expectSyncTree

Function expectSyncTree

packages/effect/test/Schema/ParseResultFormatter.test.ts:14–26  ·  view source on GitHub ↗
(
  schema: S.Schema<A, I>,
  input: unknown,
  expected: string,
  options?: {
    readonly parseOptions?: AST.ParseOptions | undefined
  } | undefined
)

Source from the content-addressed store, hash-verified

12import * as Util from "./TestUtils.js"
13
14const expectSyncTree = <A, I>(
15 schema: S.Schema<A, I>,
16 input: unknown,
17 expected: string,
18 options?: {
19 readonly parseOptions?: AST.ParseOptions | undefined
20 } | undefined
21) => {
22 const actual = S.decodeUnknownEither(schema)(input, options?.parseOptions).pipe(
23 Either.mapLeft((e) => ParseResult.TreeFormatter.formatIssueSync(e.issue))
24 )
25 assertLeft(actual, expected)
26}
27
28const expectSyncIssues = <A, I>(
29 schema: S.Schema<A, I>,

Callers 1

Calls 2

assertLeftFunction · 0.90
pipeMethod · 0.65

Tested by

no test coverage detected