Skip to main content
← Back to course

The Test Explorer

VS Code's Test Explorer gives you one consistent way to discover, run, and read test results — regardless of which testing framework your project actually uses.

The Test Explorer view (Activity Bar, the beaker icon) discovers tests automatically, once the relevant language/testing extension is installed — Jest, Vitest, Mocha, pytest, and many others all surface here through their respective extensions, not a single VS Code-specific test format.

Run a single test, a group, or your entire suite from the same tree view. Click the play icon next to any test, file, or folder — results show inline as green checks or red X's, updating live as tests run.

A failed test shows its failure message and diff directly, often inline in the editor — the exact assertion that failed, expected vs. actual, frequently without needing to open a separate output panel.

Debug a test the same way you debug any code (from the Debugging course) — right-click a test → "Debug Test" sets breakpoints and steps through exactly like any other debug session, using the same Run and Debug view.

Continuous Test Run (a toggle in Test Explorer) re-runs affected tests automatically as you save files — genuinely useful for tight test-driven iteration, seeing pass/fail update live without manually re-triggering a run after every change.

Why this matters for you

One consistent Test Explorer experience regardless of underlying framework means switching between projects using different test tools doesn't mean relearning a new testing workflow each time.

▶️ Before the next lesson

If your project has an existing test suite, open Test Explorer and confirm it discovers your tests — if it doesn't, check whether the relevant testing extension for your framework is installed (the Extensions course covers evaluating and installing one).