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

Function assertTypedFailure

packages/effect/test/sql/SqlClient.test.ts:211–221  ·  view source on GitHub ↗
(exit: Exit.Exit<A, E>, error: E)

Source from the content-addressed store, hash-verified

209 )
210
211const assertTypedFailure = <A, E>(exit: Exit.Exit<A, E>, error: E) => {
212 assert.isTrue(Exit.isFailure(exit))
213 if (!Exit.isFailure(exit)) {
214 return
215 }
216 assert.isFalse(
217 Cause.hasDies(exit.cause),
218 `expected a typed failure but the cause contains a defect:\n${Cause.pretty(exit.cause)}`
219 )
220 assert.deepStrictEqual(Cause.findErrorOption(exit.cause), Option.some(error))
221}
222
223/** Collects every span a traced effect creates, in the order they start. */
224const recording = () => {

Callers 1

SqlClient.test.tsFile · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected