···102102| `--retry <times>` | Retry the test specific number of times if it fails |
103103| `--exclude <glob>` | Additional file globs to be excluded from test |
104104| `--expand-snapshot-diff` | Show full diff when snapshot fails |
105105+| `--disable-console-intercept` | Disable automatic interception of console logging (default: `false`) |
105106| `--typecheck [options]` | Custom options for typecheck pool. If passed without options, enables typechecking |
106107| `--typecheck.enabled` | Enable typechecking alongside tests (default: `false`) |
107108| `--typecheck.only` | Run only typecheck tests. This automatically enables typecheck (default: `false`) |
···5959 .option('--diff <path>', 'Path to a diff config that will be used to generate diff interface')
6060 .option('--exclude <glob>', 'Additional file globs to be excluded from test')
6161 .option('--expand-snapshot-diff', 'Show full diff when snapshot fails')
6262+ .option('--disable-console-intercept', 'Disable automatic interception of console logging (default: `false`)')
6263 .option('--typecheck [options]', 'Custom options for typecheck pool')
6364 .option('--typecheck.enabled', 'Enable typechecking alongside tests (default: false)')
6465 .option('--typecheck.only', 'Run only typecheck tests. This automatically enables typecheck (default: false)')
···668668 * Show full diff when snapshot fails instead of a patch.
669669 */
670670 expandSnapshotDiff?: boolean
671671+672672+ /**
673673+ * By default, Vitest automatically intercepts console logging during tests for extra formatting of test file, test title, etc...
674674+ * This is also required for console log preview on Vitest UI.
675675+ * However, disabling such interception might help when you want to debug a code with normal synchronus terminal console logging.
676676+ *
677677+ * This option has no effect on browser pool since Vitest preserves original logging on browser devtools.
678678+ *
679679+ * @default false
680680+ */
681681+ disableConsoleIntercept?: boolean
671682}
672683673684export interface TypecheckConfig {
+5
test/config/fixtures/console/basic.test.ts
···11+import { test } from 'vitest'
22+33+test('basic', () => {
44+ console.error("__test_console__");
55+})
+3
test/config/fixtures/console/vitest.config.ts
···11+import { defineConfig } from 'vitest/config'
22+33+export default defineConfig({})