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

Function expectMessage

packages/effect/test/JsonPatch.test.ts:6–11  ·  view source on GitHub ↗
(f: () => unknown, includes: string)

Source from the content-addressed store, hash-verified

4import type * as Schema from "effect/Schema"
5
6const expectMessage = (f: () => unknown, includes: string) => {
7 throws(f, (e) => {
8 if (e instanceof Error && e.message.includes(includes)) return undefined
9 throw e
10 })
11}
12
13const expectAppliesTo = (patch: JsonPatch.JsonPatch, oldValue: Schema.Json, newValue: Schema.Json) => {
14 deepStrictEqual(JsonPatch.apply(patch, oldValue), newValue)

Callers 1

JsonPatch.test.tsFile · 0.85

Calls 1

throwsFunction · 0.90

Tested by

no test coverage detected