Watch Mode

The affected tests rerun
on every save

Save an Apex file and renmy runtime reruns the affected tests, with no terminal command and no manual trigger. Results arrive in under a second.

The edit-save-test cycle

The usual Apex cycle is deploying to a scratch org, waiting for the deploy, running the test and reading the output. That takes minutes per iteration.

With watch mode the cycle is write, save, read the result. renmy runtime detects the file change, compiles the affected class in-process and reruns the relevant tests, typically in under 200ms for a single class. Nothing is deployed.

Watch mode works from the terminal with renmy test:watch and is built into the Dev UI, where the Watch button starts a watcher in the browser.

Watch cycle
  1. writeWrite a failing test
  2. saveSave → tests run automatically~180ms
  3. readSee the failure inline
  4. implementWrite the implementation
  5. saveSave → tests run again~180ms
  6. passGreen, then the next test
↺ Repeats on every save

Terminal watch mode

Run renmy test:watch in your project directory. renmy starts watching your Apex source files and reruns tests on save; the terminal view redraws with each result.

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

Pass --no-impact to rerun the full pattern on every change instead of only the affected tests, for small projects or when you want the whole suite after every edit.

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

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

# Rerun the full suite on every change
renmy test:watch --no-impact

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

# Keys while it runs
# r  re-run   o  full errors   w  show dirs   q  quit

Terminal output

Watch mode keeps one view of the last run: how many tests failed and passed, the duration and the time of the run, which tests the change affected, then each failure with its message. The next save redraws it; between saves it waits.

Terminal - renmy test:watch
renmy test:watch watching 3 dir(s)
✗ 1 failed · 5 passed · 6 total · 69ms · 14:23:01 · #2
impact: 6 of 412 tests impacted — impacted by AccountService.cls — 6 tests
✗ AccountServiceTest.testCreateWithDefaults
Assertion Failed: Expected: Technology, Actual: null
[r] re-run · [o] full errors · [w] show dirs · [↑↓] scroll · [q] quit

Watch mode in the Dev UI

In renmy dev, the Watch button in the toolbar starts a file watcher. Save a class and the tests rerun, with the results updating in the browser as they complete.

The Watch scope dropdown restricts watching to one package path in multi-package projects, so only that package's tests rerun on save, which keeps reruns short 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, so more cores mean faster reruns.

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

Scoping the watcher

In large projects, rerunning every test on every save takes too long. Watch mode has two ways to narrow it.

Pattern scoping: pass a test pattern and only tests matching that pattern rerun on any file change. Useful when you are working in one area and do not need the full suite.

Path scoping: pass a folder path instead of a pattern to 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
renmy test:watch "AccountServiceTest.*"

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

Editor integration

VS Code

A Watch toggle in the status bar

Click Watch: off in the status bar, or run Renmy: Toggle Watch Mode. The item then reads Watch: all, shows Watch: running on each save and reports Watch: all passed or Watch: 2 failed. Watch stays on this machine, so the run target in the status bar has to read Renmy: Local.

IntelliJ

A Watch toggle in the tool window

renmy runtime for JetBrains adds a Watch toggle to its tool window. Enable it, save a file, and results update in the test tree. The plugin highlights failing lines in the editor margin.

Terminal

renmy test:watch

renmy test:watch runs from any terminal without an editor plugin. Useful when pairing, in remote environments, or in editors without a renmy runtime plugin.

Dev UI

Browser-based watch

Run renmy dev and enable Watch in the toolbar. Results stream to the browser over WebSocket: test tree, inline failure messages, live coverage percentages. It runs alongside your editor.

Tests rerun on save

Save a file and the affected tests run, with no deploy and no terminal command. Use renmy test:watch in a terminal or the Watch button in the Dev UI.