Skip to Content
VS Code ExtensionRunning Tests

Running Tests

The extension provides multiple ways to run tests, from single-click gutter buttons to full project runs.


Play buttons

Gutter button

Every test() call gets a Play button in the gutter (line number area). Click to run that single test. The Result Viewer opens automatically when the run finishes.

Editor title bar

When a .test.ts or .test.js file is open, a Play button appears in the editor title bar. It runs all tests in the current file.

Test Explorer

The Test Explorer sidebar (Testing icon in the Activity Bar) lists all discovered tests. You can run tests at any level: individual test, file, or folder.

Tests are grouped into Explore (from explore/) and Tests (from tests/). Multi-workspace projects show project-level nodes.

Right-click for Debug: right-click any Play button and select Debug Test to run with breakpoints. See Debugging.


Keyboard shortcuts

Shortcut (Mac)Shortcut (Win/Linux)Action
Cmd+Alt+TCtrl+Alt+TRun all tests in the current file
Cmd+Shift+RCtrl+Shift+RRe-run the last test (single, file, or project)

Run file / Run project

  • Run file — Command Palette: Glubean: Run All Tests in File, or Cmd+Alt+T, or the editor title bar Play button, or right-click a test file in the Explorer sidebar.
  • Run project — Command Palette: Glubean: Run All Tests in Project, or right-click any folder in the Explorer sidebar. Runs all test files under that folder.

Rerun workflows

Re-run last

Cmd+Shift+R (or Glubean: Re-run Last Request from the Command Palette) repeats whatever you ran last — single test, file, or project. If there is no previous run, you get a prompt.

Rerun Failed

After a run with failures, you can re-run only the failed tests:

  • Result Viewer — click the Rerun Failed (N) button in the header.
  • Command PaletteGlubean: Rerun Failed Tests.

Test Explorer layout

Configure how tests appear in the sidebar with glubean.testExplorerLayout:

ValueBehavior
"flat"Files listed directly under the project node, no directory hierarchy
"tree"Full directory hierarchy (e.g. dummyjson/ > smoke.test.ts)
"auto" (default)Flat when 15 or fewer files, tree when more

The layout refreshes automatically when the setting changes.

Multi-step tests in the tree

Builder-style tests (using .step()) display each step as a child node:

auth-flow login (142ms) get profile (89ms) update name AssertionError: expected 200, got 422

Glubean Panel

The Glubean panel lives in the Testing sidebar and gives you quick access to pinned tests, pinned files, and tasks.

Pinned Tests

Pin individual tests to the panel so you can re-run them without scrolling through the Test Explorer.

How to pin:

  • Click the $(pin) CodeLens that appears next to each test() call.

How to use:

  • Click the test name to open the source file at that test.
  • runs the test.
  • removes it from the panel.

Pinned Files

Pin entire test files for quick access.

How to pin:

  • Click the $(pin) CodeLens at the top of any .test.ts / .test.js file.
  • Or right-click a test file in the Explorer sidebar → Pin to Glubean.

How to use:

  • Click to open the file.
  • runs all tests in the file.
  • removes it from the panel.

Persistence

Pinned tests and files are stored in your workspace state and persist across editor restarts. They are per-workspace, so different projects have their own pinned items.


Tasks Panel

If your package.json defines scripts containing glubean run, they appear in the Glubean Tasks panel (inside the Testing sidebar).

Each task shows its name, status (idle / running / passed / failed), and last run summary (e.g. “2/3 passed 5m ago”). Click the Play button next to a task to run it.

Use the title bar buttons to Run All Tasks (sequential) or Refresh the list.

After a task completes, the Result Viewer opens automatically based on the glubean.openResultAfterTask setting ("always", "failures" (default), or "never").


explore/ vs tests/

  • explore/ is your API collection — the code-first replacement for Postman collections. Each file covers one or more endpoints, test.pick saves multiple parameter sets per endpoint, and you pick the one you need. Committed to git, shared with the team.
  • tests/ is your regression suite — runs in CI with glubean run tests/. Use test.each to run every case, every time.

When an exploration becomes stable enough for CI, copy it to tests/ and switch from test.pick to test.each.


What’s next?

Last updated on