> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# silent


[Added in v0.10.0](https://github.com/web-infra-dev/rstest/releases/tag/v0.10.0)

- **Type:** `boolean | 'passed-only'`
- **Default:** `false`
- **CLI:** `--silent [value]`

Silence intercepted console output from tests.

- Set `true` to hide all intercepted console logs.
- Set `'passed-only'` to keep intercepted logs only for failed files, suites, and test cases.


**CLI**

```bash
npx rstest --silent=passed-only
```


**rstest.config.ts**

```ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  silent: 'passed-only',
});
```


## Example

When `silent` is set to `'passed-only'`, console logs from passing tasks are buffered and discarded, while logs from failed tasks are replayed with the failure output.

```ts title="example.test.ts"
import { describe, expect, it } from '@rstest/core';

describe('math', () => {
  it('passes', () => {
    console.log('pass log');
    expect(1 + 1).toBe(2);
  });

  it('fails', () => {
    console.log('fail log');
    expect(1 + 1).toBe(3);
  });
});
```

Only `fail log` will be printed.

:::note
Rstest tries to attribute logs to specific tests, but in concurrent asynchronous test scenarios in browser mode, log attribution may not be perfectly accurate.

In browser mode, this interception still calls the original `console.*` so logs can remain visible in DevTools. `silent` controls Rstest/reporter output, not necessarily the browser's native console view.

Under `silent: 'passed-only'`, the logs replayed from failed tasks still pass through [onConsoleLog](/config/test/on-console-log.md), so a filter that returns `false` drops them from the replay as well.

`silent` still works when `disableConsoleIntercept` is `true`, but the replay differs by environment. In Node mode the buffered logs are replayed to the original stdout/stderr, bypassing [onConsoleLog](/config/test/on-console-log.md) and [printConsoleTrace](/config/test/print-console-trace.md). In browser mode there is no host-side original stream, so the replay is not forwarded to the terminal — those logs stay visible only in the browser DevTools.
:::
