You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using unexpected, and the new ANSI escape sequence parsing in wallaby (issue #237), wallaby displays the full colour error message.
However, when a newline is immediately followed by an escape code, the newline is swallowed.
Compare:
with the same test run on the console (unexpected is actually intellegent about the line breaks, so this is on a narrower console, if the console is wider, there's just a space, not sure if that has something to do with it, but the mock tests in the demo below would suggest not)
I've mocked out the UnexpectedError object to try and work out exactly when they're swallowed, and it appears to be when an escape code immediately follows the new line.
One "real" test is included, where the difference between running npm test in the console and running it in wallaby can be seen.
3 small "mock" tests that only really work in wallaby also show the difference a single space makes following the line break.
it('shows line breaks when lines begin with letter',function(){thrownewUnexpectedError('\x1b[32mLine one\nLine two\x1b[39m');});it('swallows line breaks when lines begin with ansi code',function(){thrownewUnexpectedError('\x1b[32mLine one\nLine two\x1b[39m\n\x1b[31mLine 3\x1b[39m');});it('a simple space is enough to keep the line break',function(){thrownewUnexpectedError('\x1b[32mLine one\nLine two\x1b[39m\n \x1b[31mLine 3\x1b[39m');});
Using unexpected, and the new ANSI escape sequence parsing in wallaby (issue #237), wallaby displays the full colour error message.
However, when a newline is immediately followed by an escape code, the newline is swallowed.
Compare:
with the same test run on the console (unexpected is actually intellegent about the line breaks, so this is on a narrower console, if the console is wider, there's just a space, not sure if that has something to do with it, but the mock tests in the demo below would suggest not)
I've mocked out the
UnexpectedError
object to try and work out exactly when they're swallowed, and it appears to be when an escape code immediately follows the new line.A demo is at bruderstein/wallaby-ansi-parser
One "real" test is included, where the difference between running
npm test
in the console and running it in wallaby can be seen.3 small "mock" tests that only really work in wallaby also show the difference a single space makes following the line break.
Wallaby IntelliJ plugin 1.0.28
Wallaby core 1.0.104
WebStorm 11 (142.4148), Linux
Thank you :)
The text was updated successfully, but these errors were encountered: