Skip to content

Commit

Permalink
clean up cause test
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Mar 21, 2024
1 parent 2240143 commit bee8bad
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/schema/test/Cause/cause.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@ describe("Cause > cause", () => {

let failWithStack = S.encodeSync(schema)(Cause.die(new Error("fail")))
assert(failWithStack._tag === "Die")
assert(
typeof failWithStack.defect === "object" && failWithStack.defect !== null && "message" in failWithStack.defect &&
"name" in failWithStack.defect
)
assert.strictEqual(failWithStack.defect.name, "Error")
assert.strictEqual(failWithStack.defect.message, "fail")
assert.deepStrictEqual(failWithStack.defect, {
name: "Error",
message: "fail"
})

failWithStack = S.encodeSync(schemaUnknown)(Cause.die(new Error("fail")))
assert(failWithStack._tag === "Die")
Expand Down

0 comments on commit bee8bad

Please sign in to comment.