feat(watch mode): Add watch mode support with CLI options and enhanced documentation

This commit is contained in:
2025-05-26 04:37:38 +00:00
parent 7aaeed0dc6
commit 82757c4abc
12 changed files with 336 additions and 9 deletions

View File

@@ -217,6 +217,33 @@ The Enhanced Communication system has been implemented to provide rich, real-tim
- Parser handles events asynchronously for real-time updates
- Visual diffs are generated using custom diff algorithms for each data type
## Watch Mode (Phase 4)
tstest now supports watch mode for automatic test re-runs on file changes.
### Usage
```bash
tstest test/**/*.ts --watch
tstest test/specific.ts -w
```
### Features
- **Automatic Re-runs**: Tests re-run when any watched file changes
- **Debouncing**: Multiple rapid changes are batched (300ms delay)
- **Clear Output**: Console is cleared before each run for clean results
- **Status Updates**: Shows which files triggered the re-run
- **Graceful Exit**: Press Ctrl+C to stop watching
### Options
- `--watch` or `-w`: Enable watch mode
- `--watch-ignore`: Comma-separated patterns to ignore (e.g., `--watch-ignore node_modules,dist`)
### Implementation Details
- Uses `@push.rocks/smartchok` for cross-platform file watching
- Watches the entire project directory from where tests are run
- Ignores changes matching the ignore patterns
- Shows "Waiting for file changes..." between runs
## Fixed Issues
### tap.skip.test(), tap.todo(), and tap.only.test() (Fixed)