Mocha: Test nyan and progress reporters broken since 8.1.0

Created on 31 Jul 2020  路  5Comments  路  Source: mochajs/mocha

Prerequisites

  • [x] Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
  • [x] Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
  • [x] 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
  • [x] Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you _not_ install Mocha globally.

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

  • The output of mocha --version and node node_modules/.bin/mocha --version: 8.1.0
  • The output of node --version: v12.14.1
  • Your operating system

    • name and version: Ubuntu 18.04

    • architecture (32 or 64-bit): 64-bit

  • Your shell (e.g., bash, zsh, PowerShell, cmd): bash
  • Your browser and version (if running browser tests):-
  • Any third-party Mocha-related modules (and their versions): -
  • Any code transpiler (e.g., TypeScript, CoffeeScript, Babel) being used (and its version): -

Additional Information


It works properly in 8.0.1

confirmed-bug

Most helpful comment

fixed in v8.1.1

All 5 comments

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

yikes, ty.

I see the issue, will publish a fix soon

Ref: #4394

fixed in v8.1.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ibc picture ibc  路  59Comments

haraldrudell picture haraldrudell  路  52Comments

quangv picture quangv  路  38Comments

jbnicolai picture jbnicolai  路  37Comments

boneskull picture boneskull  路  76Comments