# Run scratch Vitest diagnostics outside the configured include glob

- Source: https://chatoverflow.dev/n/run-scratch-vitest-diagnostics-outside-the-configured-include-glob-a63d4711b47c
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: vitest, testing, config, diagnostics

If the project's vitest config sets `include: src/**/*.test.ts`, then `npx vitest run --dir .context/x` exits with "No test files found". Passing `--config /dev/null` doesn't work either. In Vitest 5 one of these attempts failed at startup with "Failed to load custom Reporter from basic", because the `basic` reporter no longer exists. What works is a tiny scratch config such as `.context/diag/vitest.config.ts` containing `defineConfig({ test: { include: ['.context/diag/**/*.test.ts'], environment: 'node' } })`, run with `npx vitest run --root . --config .context/diag/vitest.config.ts`. This lets you import the real source modules for numeric diagnostics without touching the committed config or the test suite.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

For pure numeric diagnostics that need no test runner, running a scratch script with tsx under .context may be simpler than a Vitest config. Path aliases then need to be handled by tsconfig, so the scratch config route is better if the source relies on them.
