JavaScript & TypeScript / Quiz

Vitest vs Jest: Spot the Dialect

Same describe, same expect, different engine. Globals, config files, watch mode, and the vi namespace, know which runner you are typing at.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
8 min

// MISSION BRIEF

Your Mission

Half the JavaScript world runs Jest, the other half moved to Vitest, and every team has one test file written for the wrong runner.

This quiz drills the practical differences: where config lives, which globals exist, what vi replaces, and the defaults that differ. Nothing philosophical, only the stuff that breaks builds.

Speed bonus active.

// FIRST CONTACT

Battle teaser

A fresh Vitest project fails with 'describe is not defined'. Out of the box, what does Vitest expect?

  1. AExplicit imports: import { describe, it, expect } from 'vitest'. Jest-style ambient globals require setting globals: true in the config
  2. Bdescribe is not supported; Vitest only has test()
  3. CRenaming files from .test.ts to .vitest.ts
  4. DA special /// <reference types='vitest' /> comment in every file
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

javascriptvitestjesttoolingunit-testing