Closed stroncium closed 5 years ago
I merged https://github.com/chalk/wrap-ansi/pull/32, can you rebase and remove the .failing
part from that test instead? I think it makes more sense to keep it as a separate test.
// @coreyfarrell
@sindresorhus I've just realized another question - should strings be wrapped before or after trimming? Currently wrapping is done before trimming which produces the following results:
// 3 spaces before / between / after
t.is(wrapAnsi(' foo bar ', 6), 'foo\nbar');
t.is(wrapAnsi(' foo bar ', 3), '\nfoo\n\nbar\n');
@coreyfarrell @sindresorhus It's not a question of trim first or not(trimming is not just a stage), it's a bug, and I guess part of it was introduced by my big patch. Anyhow, added test, fixed.
@stroncium I just verified that all cliui
tests now pass when wrap-ansi
code is updated with this PR. Thanks!
Thanks for fixing, @stroncium 👍
Added tests from #32 and fixed code to pass them.