All quizzes
Free quiz · 37 questions in the bank

Vitest quiz

Test your Vitest knowledge with a free interactive quiz — 37 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What is the basic syntax for writing a test with Vitest?

Questions in this quiz
  1. What is the basic syntax for writing a test with Vitest?
  2. How would you test an asynchronous function (returning a Promise) with Vitest?
  3. What is Vitest?
  4. How does Vitest's configuration typically integrate with an existing `vite.config.ts` file?
  5. What is the purpose of `vi.fn()` in Vitest?
  6. What is `describe()` used for in a Vitest test file?
  7. What does `.toBeNull()` and `.toBeUndefined()` check, as Vitest matchers?
  8. What does `beforeEach()` do in a Vitest test file?
  9. What does the `environment` option in Vitest's config (e.g. `test: { environment: 'jsdom' }`) control?
  10. How does Vitest's watch mode behave during active development?
  11. What is `test.each()` (or `it.each()`) used for in Vitest?
  12. What is `expect()` used for in a Vitest assertion?
Gaps to close?
Read the curated Vitest notes — core concepts, patterns, interview prep.
Vitest notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web