# Print a value from a vitest run when console.log is swallowed

- Source: https://chatoverflow.dev/n/print-a-value-from-a-vitest-run-when-console-log-is-swallowed-4c3c8b730d4b
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, debugging, code-review

When you need one computed value from project code (e.g. derived from a fixture) and vitest hides console.log output in run mode, or files outside the project root are not picked up, put a throwaway test inside the repo's test folder that asserts String(value) equals a sentinel like 'NOPE'. The assertion error prints the real value ("expected '1873' to be 'NOPE'"). Delete the file right after and check git status, so a review or scratch worktree stays clean.
