Closed sindresorhus closed 7 years ago
Is this test correct https://github.com/sindresorhus/cli-truncate/blob/dbc522d6f3c1fd7b287b39521ed73a7c9e98fd66/test.js#L16? We're testing the opposite in slice-ansi
https://github.com/chalk/slice-ansi/blob/master/test.js#L46. The surrogate pairs are counted as a single character and not two.
The fullwidth character test works with the new version of slice-ansi
though.
Is this test correct /test.js@
dbc522d
#L16?
No, I don't think it's correct.
Nah, me neither. The visual width should only be one character. Will supply a PR with a bump of slice-ansi
and fixed tests.
https://github.com/sindresorhus/cli-truncate/blob/dbc522d6f3c1fd7b287b39521ed73a7c9e98fd66/test.js#L15-L17
Depends on https://github.com/chalk/wrap-ansi/issues/10 and https://github.com/chalk/wrap-ansi/issues/11.
Note to self: Update the readme description when this is fixed.