Watch Mode

Save. Tests run.
Results appear.

Watch mode closes the TDD loop. Save an Apex file and Nimbus reruns the affected tests immediately - no terminal command, no manual trigger. Feedback in under a second.

The TDD loop, accelerated

The standard Apex TDD loop involves deploying to a scratch org, waiting for the deploy to complete, running the test, and reading the output. That loop takes minutes per iteration - long enough to break focus.

With Nimbus watch mode, the loop is: write code, save, see results. No deploy. No waiting. Nimbus detects the file change, compiles the affected class in-process, and reruns the relevant tests - typically in under 200ms for a single class.

Watch mode works from the terminal with nimbus test:watch, and it's also built into the Dev UI - click the Watch button and the same feedback loop runs in your browser.

The watch loop
1Write a failing test
2Save → tests run automatically~180ms
3See the failure inline
4Write the implementation
5Save → tests run again~180ms
6Green. Move to next test.
↺ Loop repeats on every save

Terminal watch mode

Run nimbus test:watch in your project directory. Nimbus starts watching your Apex source files and reruns tests immediately on save - results stream to the terminal as they complete.

By default, watch mode reruns tests related to the saved file. If you saveAccountService.cls, Nimbus reruns test classes that reference AccountService. You can also pass an explicit pattern to restrict which tests run.

Pass --all to rerun the full test suite on every change - useful for small projects or when you want a complete signal after every edit.

bash
# Watch and rerun affected tests on save
nimbus test:watch

# Watch with explicit test pattern
nimbus test:watch "AccountServiceTest.*"

# Rerun all tests on every change
nimbus test:watch --all

# Watch a specific package directory
nimbus test:watch --path force-app/main/default

# Output
# Watching force-app/**/*.cls ...
# [14:23:01] AccountService.cls changed
# [14:23:01] Running AccountServiceTest... ✓ 6/6 (182ms)
# [14:23:01] Ready.

What you see

Watch mode output is designed for fast scanning. Pass/fail per method, failure messages inline, duration per run. No noise between saves.

Terminal - nimbus test:watch
Watching force-app/**/*.cls ...
Press Ctrl+C to stop. Press Enter to rerun.
[14:23:01] AccountService.cls changed
Running AccountServiceTest (6 methods)...
✓ testCreateAccount 12ms
✓ testBulkInsert 8ms
✓ testQueryByIndustry 15ms
✓ testUpdateName 11ms
✓ testDeleteAccount 9ms
✗ testCreateWithDefaults 14ms
Expected: Technology, Actual: null
at AccountService.createWithDefaults line 18
at AccountServiceTest.testCreateWithDefaults line 42
5 passed, 1 failed - 69ms total
Ready.
[14:23:18] AccountService.cls changed
Running AccountServiceTest (6 methods)...
✓ testCreateAccount
✓ testBulkInsert
✓ testQueryByIndustry
✓ testUpdateName
✓ testDeleteAccount
✓ testCreateWithDefaults
6 passed - 63ms total
Ready.

Watch mode in the Dev UI

If you're using nimbus dev, watch mode is a single click. Hit the Watch button in the toolbar and the same file watcher activates - results update live in the browser as tests complete.

The Dev UI adds one thing the terminal doesn't have: a Watch scope dropdown. In multi-package projects, you can restrict watch to a specific package path. Only tests related to that package rerun on save - keeping the feedback loop fast even in large monorepos.

The parallel workers panel appears during runs and shows each active test worker and what it's currently running. Watch respects your nimbus.test.parallel setting - more cores means faster reruns.

☁ Nimbus Dev● Watching
▶ Run All↺ Run Failed◉ Watch ▾● Running
Watch scope
All packagesforce-app/mainforce-app/admin
Workers
AccountServiceTest.testBulkInsert
AccountTriggerTest.testBeforeInsert
CalculatorTest.testAddition
CollectionUtilsTest.testGroupBy

Keeping the loop fast

In large projects, rerunnning all tests on every save slows down the loop. Watch mode gives you two levers to keep feedback fast.

Pattern scoping: pass a test pattern and only tests matching that pattern rerun on any file change. Useful when you're focused on a specific feature area and don't need the full suite.

Path scoping: pass --pathto restrict which source files are watched. Changes outside that path are ignored. Useful in monorepos where packages are independent.

bash
# Only rerun AccountServiceTest on any change
nimbus test:watch "AccountServiceTest.*"

# Watch a specific directory
nimbus test:watch --path force-app/main/default/classes

# Combine: pattern + path scope
nimbus test:watch "AccountServiceTest.*" \
  --path force-app/main/default

# Configure default watch settings in nimbus.properties:
# nimbus.watch.path=force-app/main/default
# nimbus.watch.pattern=AccountServiceTest.*

Editor integration

VS Code

Auto-run on save

The Nimbus extension activates watch mode automatically when you open an Apex test class. Save any Apex file and results update in the Test Explorer sidebar - pass/fail per method, inline failure messages, coverage gutter decorations.

IntelliJ

Watch from the tool window

The Nimbus plugin adds a Watch toggle to the Nimbus tool window. Enable it and the same loop runs - save a file, results update in the test tree. The plugin highlights failing lines directly in the editor margin.

Terminal

nimbus test:watch

No editor plugin required. Run nimbus test:watch from any terminal and get the same feedback loop. Useful when pairing, in remote environments, or in editors without a Nimbus plugin.

Dev UI

Browser-based watch

Run nimbus dev and enable Watch in the toolbar. Results stream to the browser via WebSocket - test tree, inline failure messages, live coverage percentages. Works alongside your editor, not instead of it.

The shortest path from red to green.

Save a file. Tests run. Results appear. No deploy, no terminal command, no waiting. nimbus test:watch or click Watch in the Dev UI - same loop, your preference.