kopia lustrzana https://github.com/badgen/badgen
Update tests
rodzic
e75f9dbde6
commit
ce81f7ea29
|
@ -3,8 +3,7 @@ const { Arial12 } = require('../lib/calc-text-width.js')
|
||||||
|
|
||||||
tap.test('calc width for "npm"', t => {
|
tap.test('calc width for "npm"', t => {
|
||||||
t.ok(typeof Arial12 === 'function', 'export function: Arial12')
|
t.ok(typeof Arial12 === 'function', 'export function: Arial12')
|
||||||
t.ok(Number.isFinite(Arial12('npm')), 'result is number')
|
t.ok(Number.isFinite(Arial12('npm')), 'result is a number')
|
||||||
t.ok(Arial12('npm') > 0, 'result is positive number')
|
t.is(Arial12('npm'), 24.6, 'result is correct value')
|
||||||
t.ok(Arial12('npm') === 24.543750000000003, 'result is correct value')
|
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,12 +3,12 @@ const badgen = require('..')
|
||||||
|
|
||||||
tap.test('generate badge with { subject, status }', t => {
|
tap.test('generate badge with { subject, status }', t => {
|
||||||
const svg = badgen({ subject: 'npm', status: 'v1.0.0' })
|
const svg = badgen({ subject: 'npm', status: 'v1.0.0' })
|
||||||
t.ok(typeof svg === 'string', 'generate without error')
|
t.ok(typeof svg === 'string', 'successfully generated')
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.test('generate badge with { subject, status, color }', t => {
|
tap.test('generate badge with { subject, status, color }', t => {
|
||||||
const svg = badgen({ subject: 'npm', status: 'v1.0.0', color: 'ADF' })
|
const svg = badgen({ subject: 'npm', status: 'v1.0.0', color: 'ADF' })
|
||||||
t.ok(typeof svg === 'string', 'generate without error')
|
t.ok(typeof svg === 'string', 'successfully generated')
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
Ładowanie…
Reference in New Issue