mochajs / mocha

☕️ simple, flexible, fun javascript test framework for node.js & the browser
https://mochajs.org
MIT License
22.54k stars 3.01k forks source link

Test nyan and progress reporters broken since 8.1.0 #4393

Closed jormaechea closed 4 years ago

jormaechea commented 4 years ago

Prerequisites

Description

Running tests in the terminal (bash) with the nyan and progress reporters are broken, the output is a mess.

Steps to Reproduce

Run npx mocha -R nyan test.js or npx mocha -R progress test.js with the following file:

const assert = require('assert');

describe('Bug test', () => {

    for(let i = 0; i < 200; i++) {
        it('Should do something', () => assert(true));
    }

});

Expected behavior: [What you expect to happen] The nyan cat or the progress bar shouldn't exceed terminal width.

Actual behavior: [What actually happens]

It breakes awfully, by exceeding the terminal width and generating unexpected line breaks.

Reproduces how often: [What percentage of the time does it reproduce?] 100%

Versions

Additional Information

It works properly in 8.0.1

RiccardoMargiotta commented 4 years ago

I'm seeing similar line-break issues with the 'dot' reporter, also fine in 8.0.1.

8.0.1 image

8.1.0 image

boneskull commented 4 years ago

yikes, ty.

boneskull commented 4 years ago

I see the issue, will publish a fix soon

boneskull commented 4 years ago

Ref: #4394

boneskull commented 4 years ago

fixed in v8.1.1