Testing · Junior · Question 14 of 78
Which files does Jest pick up as tests by default?
- ✓Correct answer: Files ending in
.test.js/.spec.js(and ts/jsx/tsx) and files in__tests__folders - 2Only files in the
tests/folder at the project root - 3Every
.jsfile in the project
Explanation
The default is set by testMatch. Vitest uses a similar include pattern: **/*.{test,spec}.?(c|m)[jt]s?(x).