# TestWatcher

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/autonomous/test-watcher.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/autonomous/test-watcher.ts#L44)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `onFileEdited` | `onFileEdited(toolName: string)` | `void` |
| `dispose` | `dispose()` | `void` |
| `getLastResult` | `getLastResult()` | `TestRunResult | null` |
| `isRunning` | `isRunning()` | `boolean` |

## Where it refuses work

- `TestWatcher` stops the work with an early return when `this.disposed`, in 3 places.
- `TestWatcher` stops the work with an early return when `!this.config.enabled || this.disposed`.
- `TestWatcher` stops the work with an early return when `!LintTestLoop.isEditTool(toolName) && toolName !== 'create_file'`.

## When something fails

- `TestWatcher` handles failure in 5 places: it discards it silently in all 5.
