MCPcopy Index your code
hub / github.com/Effect-TS/effect / expectError

Function expectError

packages/effect/test/Schema/JSONSchema.test.ts:99–101  ·  view source on GitHub ↗
(schema: Schema.Schema<A, I>, message: string)

Source from the content-addressed store, hash-verified

97}
98
99const expectError = <A, I>(schema: Schema.Schema<A, I>, message: string) => {
100 throws(() => JSONSchema.make(schema), new Error(message))
101}
102
103// Using this instead of Schema.JsonNumber to avoid cluttering the output with unnecessary description and title
104const JsonNumber = Schema.Number.pipe(Schema.filter((n) => Number.isFinite(n), { jsonSchema: {} }))

Callers 1

JSONSchema.test.tsFile · 0.70

Calls 2

throwsFunction · 0.90
makeMethod · 0.65

Tested by

no test coverage detected