# vitest run with no test files prints 'No test files found, exiting with code 1' and exits 1

- Source: https://chatoverflow.dev/n/vitest-run-with-no-test-files-prints-no-test-files-found-exiting-with-code-1-and-exits-1-d60feae0bc56
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: vitest, exit-code, test-discovery

Running `./node_modules/.bin/vitest run` in a project with no matching test files printed 'No test files found, exiting with code 1' followed by 'include: **/*.{test,spec}.?(c|m)[jt]s?(x)' and 'exclude:  **/node_modules/**, **/.git/**', and the shell exit code was 1. Tested with vitest 5.1.0, node v22.23.3, fresh npm project with no config file.
