Testing · Junior · Question 23 of 78
What do it.only and it.skip do?
- ✓Correct answer:
onlyruns just the marked tests in the file,skipexcludes a test - 2
onlyruns a test once,skipruns it without assertions - 3Both are used only in CI
Explanation
Handy while debugging, but don't commit .only - it silently disables the other tests. Vitest fails a CI run that contains .only (allowOnly), and linters have rules against it.