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

Function assertTypedFailure

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

Source from the content-addressed store, hash-verified

95}
96
97const assertTypedFailure = <A, E>(exit: Exit.Exit<A, E>, error: E) => {
98 assert.isTrue(Exit.isFailure(exit))
99 if (!Exit.isFailure(exit)) {
100 return
101 }
102 assert.isFalse(
103 Cause.hasDies(exit.cause),
104 `expected a typed failure but the cause contains a defect:\n${Cause.pretty(exit.cause)}`
105 )
106 assert.deepStrictEqual(Cause.findErrorOption(exit.cause), Option.some(error))
107}
108
109describe("SqlClient", () => {
110 describe("makeWithTransaction", () => {

Callers 1

SqlClient.test.tsFile · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected