Axiomatic
Guides

Watch Mode

Overview

Watch mode monitors your source files and automatically re-runs affected tests when files change. This provides a fast feedback loop during development.

axm watch

How It Works

The watcher uses the on glob in each test to determine which file changes trigger which tests. When a file changes, only the tests whose on pattern matches that file are re-run. Tests for unrelated files are not affected.

For example, if you have a test with on: ["src/api/**/*.ts"] and you edit a file in src/components/, that test will not re-run.

Options

FlagDescription
-d, --dir <path>Project directory (default: .)
--debounce <ms>Wait time after last file change before re-running (default: 300)

Usage Examples

# Watch all tests
axm watch

# Increase debounce for slower file systems
axm watch --debounce 500

Tips

  • Watch mode works best with well-scoped on patterns. Narrow globs mean fewer unnecessary re-runs.
  • Watch mode respects the cache -- if a file changes back to its previous state, the cached result is used.

On this page