Mocha Fivemat Progress Reporter
The `mocha-fivemat-progress-reporter` package offers a specialized test reporter for the Mocha JavaScript test framework. It is designed to combine the minimalist, progress-oriented feedback of Mocha's built-in progress reporter with the condensed, informative output style of the `fivemat` reporter. This reporter visualizes test execution with a per-test-suite progress bar, providing immediate visual cues on test progress. Currently at version 0.1.0, the package was last published approximately 10 years ago (June 2016), indicating that it is no longer actively maintained. Its core differentiation lies in offering a hybrid reporting style that aims to provide both a quick overview of ongoing tests and a concise summary upon completion, making it distinct from verbose or solely progress-based reporters.
Common errors
-
Error: Cannot find reporter "mocha-fivemat-progress-reporter"
cause The reporter package is not installed or Mocha cannot locate it in `node_modules`. This often happens if it's not listed in `devDependencies` or `npm install` wasn't run.fixEnsure `mocha-fivemat-progress-reporter` is listed in your `package.json`'s `devDependencies` and run `npm install` (or `yarn add --dev mocha-fivemat-progress-reporter`). Also, verify the reporter name in the `-R` flag is spelled correctly. -
Mocha has detected a problem with your configuration: Your custom reporter must be 'mocha-fivemat-progress-reporter', but it expects an older Mocha API version.
cause The reporter was developed for an older version of Mocha and uses APIs that have been changed or removed in your current Mocha installation.fixThis package is likely incompatible with modern Mocha versions. Consider using a different, actively maintained reporter. If you absolutely need this specific reporter, you might have to downgrade your Mocha installation significantly (e.g., to a version released before 2016, like Mocha v2 or v3).
Warnings
- breaking This package is very old (last published 10 years ago) and is unlikely to be compatible with recent versions of Node.js or Mocha (v8+). It may rely on deprecated Mocha APIs or older Node.js runtime features that are no longer available.
- gotcha The project is abandoned and receives no maintenance. This means there will be no bug fixes, security updates, or feature enhancements. Using it in production or sensitive environments is not recommended.
- gotcha As an older CommonJS module, it does not natively support ES Modules (`import`/`export`) syntax directly. Attempting to import it using ES Modules in a modern Node.js environment configured for ESM will result in errors.
Install
-
npm install mocha-fivemat-progress-reporter -
yarn add mocha-fivemat-progress-reporter -
pnpm add mocha-fivemat-progress-reporter
Imports
- mocha-fivemat-progress-reporter
import reporter from 'mocha-fivemat-progress-reporter';
const reporter = require('mocha-fivemat-progress-reporter');
Quickstart
{
"name": "my-project",
"version": "1.0.0",
"description": "A project using mocha-fivemat-progress-reporter",
"devDependencies": {
"mocha": "^8.0.0",
"mocha-fivemat-progress-reporter": "^0.1.0"
},
"scripts": {
"test": "mocha -R mocha-fivemat-progress-reporter"
}
}
// test/example.test.js
const assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal([1, 2, 3].indexOf(4), -1);
});
it('should return the correct index when the value is present', function() {
assert.equal([1, 2, 3].indexOf(2), 1);
});
it('should handle zero correctly', function() {
assert.equal([0, 1, 2].indexOf(0), 0);
});
});
describe('String', function() {
it('should return the length of the string', function() {
assert.equal('hello'.length, 5);
});
it('should concatenate strings', function() {
assert.equal('hello' + 'world', 'helloworld');
});
});
});
// To run:
// 1. npm install
// 2. npm test