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

Function assertUnknownError

packages/effect/test/Effect.test.ts:53–64  ·  view source on GitHub ↗
(exit: Exit.Exit<A, Cause.UnknownError>, cause: unknown, message: string)

Source from the content-addressed store, hash-verified

51}
52
53const assertUnknownError = <A>(exit: Exit.Exit<A, Cause.UnknownError>, cause: unknown, message: string) => {
54 assert.isTrue(Exit.isFailure(exit))
55 if (Exit.isFailure(exit)) {
56 const result = Cause.findError(exit.cause)
57 assert.isTrue(Result.isSuccess(result))
58 if (Result.isSuccess(result)) {
59 assert.isTrue(Cause.isUnknownError(result.success))
60 assert.strictEqual((result.success as Error).cause, cause)
61 assert.strictEqual(result.success.message, message)
62 }
63 }
64}
65
66describe("Effect", () => {
67 it.effect("suspend treats a thrown value as a defect", () =>

Callers 1

Effect.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected