The Testing view in VS Code is your central hub for everything related to tests. It discovers tests in your project, shows them in a tree, and lets you run, debug, and inspect results without switching to a terminal.
You reach it by clicking the beaker icon in the Activity Bar on the left side of the window. You can also open it from the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS) with Testing: Focus on Test Explorer View. There is no default keyboard shortcut, so assign one yourself if you use it often. If you do not see the beaker icon, right-click the Activity Bar and make sure Testing is checked.
Before the Test Explorer shows anything useful, you need one thing: a testing extension.
Install a testing extension
VS Code does not ship with built-in test discovery for most languages. It relies on extensions that know how to find and run tests for a specific framework.
Open the Extensions view (Ctrl+Shift+X on Windows/Linux, Cmd+Shift+X on macOS). Type @category:"testing" in the search box. This filter shows only extensions that add testing support.
The extension you need depends on your language and test framework:
| Language / framework | Extension to install |
|---|---|
| Python (pytest, unittest) | Python extension (includes testing support) |
| JavaScript / TypeScript (Jest, Mocha, Node.js test runner) | Not built in. Install the Jest extension for Jest projects, or search @category:"testing" for an extension that matches your Mocha or Node.js test runner setup. |
| Java (JUnit, TestNG) | Test Runner for Java |
| Go | Not built in by default. The Go extension adds test discovery and Test Explorer support once installed. |
| C# (xUnit, NUnit, MSTest) | C# Dev Kit |
Install the extension, then open a project folder that contains tests. The Test Explorer scans your workspace and populates the tree automatically.
If tests do not appear, check the extension documentation. Some frameworks need a configuration file (like pytest.ini or jest.config.js) before discovery works. You can also use the Copilot Chat /setupTests command to get step-by-step help configuring your framework.
Understand the Test Explorer layout
The Test Explorer has three main areas.
The toolbar at the top contains buttons for running all tests, debugging all tests, running with coverage, and refreshing the test list. A filter button (funnel icon) lets you show only failed tests or only tests in the currently open file.
The tree view in the center shows your tests organized by folder, file, and test suite. Each test or group has a play button next to it for running that specific item. The tree mirrors the hierarchical structure of your test code: describe blocks, test classes, and individual test functions all appear as nested nodes.
The status bar at the bottom of the view shows how many tests passed, failed, or were skipped during the last run.
Double-click any test in the tree to jump to its source code. If you double-click a failed test, VS Code opens the file and highlights the failing line.
Run tests from the Test Explorer
Click the play button next to any node to run those tests. You can run:
- All tests in the project (toolbar play button)
- All tests in a file (play button next to the file node)
- All tests in a group or class (play button next to the group node)
- A single test (play button next to the individual test)
While tests run, a spinner replaces the play button. When the run finishes, the button returns and the node shows its result.
A green check means all tests in that node passed. A red X means at least one test failed.
The test run also updates the editor. Open a test file after a run and look at the left gutter. Each test function shows a small green check or red X. This inline feedback lets you scan a file and spot failures instantly.
Read inline test results
When a test fails, VS Code shows the error message right where you need it. Hover over the red X in the gutter next to the test function. A popup appears with the failure message and a stack trace snippet.
You can also click the Show Output button in the Test Explorer toolbar to open the Test Results panel. This panel shows the full output from the last test run, including console logs and complete error messages. Use the panel when the inline hover message is too short.
The Test Results panel has tabs for each test run. You can compare the output from different runs or keep a failed run open while you fix the code and run again.
Navigate between tests and results
VS Code gives you several ways to move between the test tree and your code.
Double-click a test in the explorer to open its file. The cursor lands on the test function, and the function is highlighted briefly.
From the editor, right-click inside a test function and select Run Test or Debug Test. You can also use the gutter play button next to the test definition. This is often faster than finding the test in the tree.
If you have the Test Explorer open, clicking a test in the tree also selects it in the editor, making it easy to see where you are.
Troubleshooting
The beaker icon is missing
Right-click the Activity Bar and make sure Testing has a checkmark. If it is checked but still hidden, your window may be too narrow. Try widening the VS Code window or hiding another Activity Bar item.
No tests appear after installing an extension
First, confirm your project actually contains tests. The Test Explorer only shows files with recognized test functions.
Second, check that your test framework is configured. For Python with pytest, VS Code looks for a pytest.ini or pyproject.toml in your workspace. For Jest, it needs a jest.config.js or a jest entry in your package.json.
Third, click the Refresh Tests button (circular arrow) in the Test Explorer toolbar. Discovery sometimes needs a manual trigger after installing an extension.
Tests show an error saying the test runner is not installed
The extension found your tests but cannot run them because the test framework is missing from your project. Install it with your package manager. For JavaScript: run npm install --save-dev jest in the terminal. For Python: run pip install pytest in your environment.
Once your tests appear in the Test Explorer, you are ready to run and debug them with breakpoints and step controls. To see which lines your tests cover, check out test coverage in VS Code.
Rune AI
Key Insights
- Open the Testing view by clicking the beaker icon in the Activity Bar, or run Testing: Focus on Test Explorer View from the Command Palette.
- Install a testing extension first. Go to the Extensions view and filter by @category:"testing" to find one for your framework.
- The Test Explorer shows all discovered tests in a tree view that mirrors your file structure and test hierarchy.
- Run a test by clicking the play button next to any test in the tree or in the editor gutter beside the test function.
- After a test run, the gutter shows a green check (passed) or red X (failed). Hover over the icon to see the error message.
Frequently Asked Questions
Why does the Test Explorer say No tests found?
Which testing extensions work with VS Code?
Can I see test results next to my code?
How do I refresh tests after adding new ones?
Conclusion
The Testing view gives you a single place to discover, run, and inspect every test in your project. Start by installing the right testing extension for your language, open the Test Explorer with the beaker icon, and let VS Code find your tests automatically. Run a test from the tree, the editor gutter, or the Command Palette. Once you can see your tests in the explorer, you are ready to run and debug them.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.