@@ -96,11 +96,35 @@ describe ( 'Fast String Width', () => {
9696 t . is ( getWidth ( '👶🏽' ) , 2 ) ;
9797 t . is ( getWidth ( '👩👩👦👦' ) , 2 ) ;
9898 t . is ( getWidth ( '👨❤️💋👨' ) , 2 ) ;
99+ t . is ( getWidth ( '🏴☠️' ) , 2 ) ;
100+ t . is ( getWidth ( '🏴' ) , 2 ) ;
101+ t . is ( getWidth ( '🇸🇪' ) , 2 ) ;
102+ t . is ( getWidth ( '🇺🇳' ) , 2 ) ;
99103
100104 t . is ( getWidth ( '👶' . repeat ( 2 ) ) , 4 ) ;
101105 t . is ( getWidth ( '👶🏽' . repeat ( 2 ) ) , 4 ) ;
102106 t . is ( getWidth ( '👩👩👦👦' . repeat ( 2 ) ) , 4 ) ;
103107 t . is ( getWidth ( '👨❤️💋👨' . repeat ( 2 ) ) , 4 ) ;
108+ t . is ( getWidth ( '🏴☠️' . repeat ( 2 ) ) , 4 ) ;
109+ t . is ( getWidth ( '🏴' . repeat ( 2 ) ) , 4 ) ;
110+ t . is ( getWidth ( '🇸🇪' . repeat ( 2 ) ) , 4 ) ;
111+ t . is ( getWidth ( '🇺🇳' . repeat ( 2 ) ) , 4 ) ;
112+
113+ } ) ;
114+
115+ it . skip ( 'supports all basic emojis' , async t => {
116+
117+ const response = await fetch ( 'https://raw.githubusercontent.com/muan/unicode-emoji-json/main/data-by-group.json' ) ;
118+ const data = await response . json ( ) ;
119+ const emojis = data . flatMap ( ( { emojis } ) => emojis . map ( ( { emoji } ) => emoji ) ) ;
120+
121+ const failures = emojis . filter ( emoji => {
122+ if ( getWidth ( emoji ) !== 2 ) {
123+ return true ;
124+ }
125+ } ) ;
126+
127+ t . deepEqual ( failures , [ ] ) ;
104128
105129 } ) ;
106130
0 commit comments