Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A Jest Reporter to group, hide and prettify spammy console warnings
| Date | Stars |
|---|---|
| 2026-07-24 | 540 |
| 2026-07-25 | 540 |
| 2026-07-28 | 540 |
| 2026-07-30 | 540 |
| 2026-08-06 | 540 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# jest-clean-console-reporter (alpha)
_A custom Jest reporter to reduce `console` spam in your test output._
---
Remember back in the day when [Jest](https://jestjs.io/) used to swallow `console.log` messages by default, and it was basically impossible to figure out why your code was failing under test? \***Sigh\***. Those were the days.
Now that Jest prints all console messages, whether from our own code, third-party framework code, or the test runner itself, we have the opposite problem: **It's easy to lose actually important warnings among noise.**
The `jest-clean-console-reporter` reporter collects all console messages written by the test process, and allows you to group them by known error warning types, or ignore them outright.

## Stating the obvious
**The best way to remove warnings in your code is to address their root cause.**
This reporter is probably best used when filtering out spammy library warnings that are otherwise tricky or impossible to get rid of, or ignoring intentional user-facing warnings of your own project.
## Usage
Install with your favorite package manager:
```sh
npm install --save-dev jest-clean-console-reporter
```
You'll also need Jest 25.1 or later installed in your project.
### Configuration
```js
// List known warnings you want to group or suppress. See docs below.
// Tip: This is just an array, you can import it from an external file
const rules = [
{
match: /^You are using the simple \(heuristic\) fragment matcher/,
group: "Apollo: You are using the simple (heuristic) fragment matcher.",
},
{
match: /^Heuristic fragment matching going on/,
group: null, // ignore outright
},
{
match: /^Warning: An update to (\w*) inside a test was not wrapped in act/,
group: "React: Act warnings",
keep: true, // include in summary, but also keep raw console output
},
];
// Add reporters to your jest config
module.exports = {
// ...
reporters: [
// Add jest-clean-console-reporter. This takes place of the
// default reporter, and behaves identically otherwise
["jest-clean-console-reporter", { rules: rules }],
// Overriding config.reporters wipes out default reporters, so
// we need to restore the summary reporter.
//
// NOTE: For jest 26.6.1 or older, this file is located at
// @jest/reporters/build/summary_reporter
"@jest/reporters/build/SummaryReporter",
],
};
```
## Options
Pass options to the reporter in your jest configuration as follows:
### Using Jest 26.6.2 or newer
```js
const jestConfig = {
reporters: [
["jest-clean-console-reporter", options], // <--
"@jest/reporters/build/SummaryReporter",
],
};
```
### Using Jest 25.1.0-26.6.1
```js
const jestConfig = {
reporters: [
["jest-clean-console-reporter", options], // <--
"@jest/reporters/build/summary_reporter",
],
};
```
### `options.rules`
Rules tell the reporter which console messages should be filtered, and how
they should be grouped in the summary.
Each rule has three options, `match`, `group` and (optionally) `keep`.
#### `rule.match : RegExp | string | (message, level, origin) => boolean`
`match` is either a regular expression, a string, or a predicate function:
- `RegExp`: Matches console message against this regular expression.
- `string`: Matches console message against this string, first using literal `===` comparison, and falls back to regular expression comparison using `message.match(match)`. The latter is not recommended, but useful if you need to serialize your regular expressions.
- A predicate function that's called with `match(message, level)` where
- `message` is the full console message
- `level` is the log level (error, warning, log etc..).
- `origin` is the stack trace string for this error. Useful if you want to ignore all errors from a certain library, for example. Note that this string can contain newlines, so any regexes used to match it should use the `/g` flag.
- Excerpt of 9,272 characters
Read on GitHub17
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:5266456ac57cbb79, topic:testing