Skip to content

Commit 18f80c7

Browse files
committed
Add more tests
1 parent 790c7e1 commit 18f80c7

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/main.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,10 @@ test.serial('Can use .beautiful() deeply', (t) => {
7070
t.true(consoleArg.includes(`${figures.cross} Error: test`))
7171
t.true(consoleArg.includes(`\n ${figures.cross} CUSTOMERROR: INNER`))
7272
})
73+
74+
test.serial('Can use "custom" option', (t) => {
75+
const error = new Error('test')
76+
error.pretty = (errorString) => errorString.toUpperCase()
77+
const { consoleArg } = handleError(error, { custom: 'pretty' })
78+
t.true(consoleArg.includes(`${figures.cross} ERROR: TEST`))
79+
})

src/options/validate.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ each(
3030
{ timeout: Number.NaN },
3131
{ timeout: Number.NEGATIVE_INFINITY },
3232
{ timeout: -1 },
33+
{ custom: 0 },
3334
{ unknown: true },
3435
{ classes: true },
3536
{ classes: { default: true } },

0 commit comments

Comments
 (0)