Skip to content

Commit b5cefad

Browse files
committed
Add a test
1 parent ec35021 commit b5cefad

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/options/classes.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,15 @@ each(
3939
})
4040
},
4141
)
42+
43+
test.serial('Apply option "classes" to nested errors', (t) => {
44+
const typeError = new TypeError('test', { cause: new URIError('test') })
45+
const { consoleArg } = handleError(typeError, {
46+
classes: {
47+
TypeError: { icon: 'warning' },
48+
URIError: { icon: 'info' },
49+
},
50+
})
51+
t.true(consoleArg.includes(`${figures.warning} TypeError: test`))
52+
t.true(consoleArg.includes(`${figures.info} URIError: test`))
53+
})

0 commit comments

Comments
 (0)