kopia lustrzana https://github.com/badgen/badgen
chore: update tests for type checking
rodzic
a8a7895702
commit
9989f76ff3
|
@ -22,8 +22,3 @@ tap.test('calc width for emojis', t => {
|
|||
t.matchSnapshot(calcWidth('💩🤱🦄', true), 'result is correct')
|
||||
t.end()
|
||||
})
|
||||
|
||||
tap.test('exception handling', t => {
|
||||
t.throws(() => calcWidth(0), TypeError, 'throw if feed with non-string input')
|
||||
t.end()
|
||||
})
|
||||
|
|
|
@ -42,3 +42,9 @@ tap.test('generate badge with { subject, status, icon, style }', t => {
|
|||
t.matchSnapshot(svg, 'snapshot')
|
||||
t.end()
|
||||
})
|
||||
|
||||
tap.test('type checking', t => {
|
||||
t.throws(() => badgen({ status: '' }), TypeError, 'throw if subject is non-string')
|
||||
t.throws(() => badgen({ subject: '' }), TypeError, 'throw if status is non-string')
|
||||
t.end()
|
||||
})
|
||||
|
|
Ładowanie…
Reference in New Issue