Skip to content

Commit e96237c

Browse files
committed
Add a test
1 parent 990eaee commit e96237c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,11 @@ test('Can use aggregate errors', (t) => {
6060
t.true(message.includes(`${figures.warning} ExitCodeError: test`))
6161
t.true(message.includes(`${figures.info} DatabaseError: inner`))
6262
})
63+
64+
test('Can pass "cause"', (t) => {
65+
const inner = new DatabaseError('inner')
66+
const outer = new ExitCodeError('test', { errors: [inner] })
67+
const message = BaseError.beautiful(outer, { cause: false })
68+
t.true(message.includes(`${figures.warning} ExitCodeError: test`))
69+
t.false(message.includes('DatabaseError'))
70+
})

0 commit comments

Comments
 (0)