pull/3/head
Amio 2018-07-11 01:34:28 +08:00
rodzic 5ed00e9ff2
commit 5a993af466
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -1,9 +1,9 @@
const tap = require('tap')
const { Arial12 } = require('../lib/calc-text-width.js')
const { Verdana12 } = require('../lib/calc-text-width.js')
tap.test('calc width for "npm"', t => {
t.ok(typeof Arial12 === 'function', 'export function: Arial12')
t.ok(Number.isFinite(Arial12('npm')), 'result is a number')
t.is(Arial12('npm'), 24.6, 'result is correct value')
t.ok(typeof Verdana12 === 'function', 'export function: Verdana12')
t.ok(Number.isFinite(Verdana12('npm')), 'result is a number')
t.is(Verdana12('npm'), 26.77, 'result is correct value')
t.end()
})