Skip to content

Commit

Permalink
test: add test for measureText to escape texts (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored Oct 27, 2024
1 parent 62cd3e7 commit 5c38c21
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __test__/draw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ test('measureText', (t) => {
t.is(metrics.actualBoundingBoxAscent, 42)
t.is(metrics.actualBoundingBoxDescent, 10)
t.true(Math.abs(metrics.actualBoundingBoxRight - 372) < 0.001)
t.notThrows(() => {
ctx.measureText('\u200b')
})
})

test('measureText with empty string should not throw', (t) => {
Expand Down

0 comments on commit 5c38c21

Please sign in to comment.