chore: update tests for type checking

pull/6/head
Amio 2018-07-25 11:30:00 +08:00
rodzic a8a7895702
commit 9989f76ff3
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -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()
})

Wyświetl plik

@ -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()
})