Skip to content

Commit

Permalink
Add test for #2 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Feb 28, 2022
1 parent d0d53da commit 8b84b9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ test('ignores control characters', t => {
test('handles combining characters', t => {
t.is(stringWidth('x\u0300'), 1);
});

test('handles ZWJ characters', t => {
t.is(stringWidth('👶'), 2);
t.is(stringWidth('👶🏽'), 2);
t.is(stringWidth('👩‍👩‍👦‍👦'), 2);
t.is(stringWidth('👨‍❤️‍💋‍👨'), 2);
});

0 comments on commit 8b84b9b

Please sign in to comment.