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.

These editor controls target discovered test() exports in *.test.ts/js/mjs files. Contract and workflow suites still live in source and can be run through MCP, npx glubean run, package scripts, or CI. If you expose a package script that calls glubean run, it can also appear in the Glubean Tasks panel.


Play buttons

Gutter button

Every discovered 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 by project folders such as Tests (from tests/) and, when present, Explore (from explore/). 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 an optional lane for fast drafts and reproductions. Use it for API exploration, bug repros, generated first passes, and test.pick cases where you want to run one example at a time.
  • tests/ is your committed regression suite. It runs through the default local/CI profile and should contain checks that the team expects to stay green.

The default glubean init project does not need explore/ to run. Add it when your team wants a committed draft lane, and add an explore profile to glubean.yaml when you want glubean run --profile explore.

When an exploration becomes stable enough for CI, move it to tests/. If a picked example set should become a full regression matrix, switch from test.pick to test.each.


What’s next?

Last updated on