diff --git a/lib/calc-text-width.js b/lib/calc-text-width.js index bb687bd..bba704c 100644 --- a/lib/calc-text-width.js +++ b/lib/calc-text-width.js @@ -17,7 +17,6 @@ function calcWidth (charWidthTable) { charCode = text[i].charCodeAt() total += widthTable[charCode < 127 ? charCode : 64] // "@" for overflows } - console.log(total) return total } } diff --git a/test/calc-text-width.spec.js b/test/calc-text-width.spec.js index 38bf409..24557fd 100644 --- a/test/calc-text-width.spec.js +++ b/test/calc-text-width.spec.js @@ -5,5 +5,6 @@ tap.test('calc width for "npm"', t => { t.ok(typeof Arial12 === 'function', 'export function: Arial12') t.ok(Number.isFinite(Arial12('npm')), 'result is number') t.ok(Arial12('npm') > 0, 'result is positive number') + t.ok(Arial12('npm') === 24.543750000000003, 'result is correct value') t.end() })