Fix "Fatal error: Invalid array length" when printing output in a non tty environment

This fix is in response to our current Jenkins integration where jasmine is running without a real terminal.