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

@@ -520,4 +520,47 @@ export class TsTestLogger {
return diff;
}
// Watch mode methods
watchModeStart() {
if (this.options.json) {
this.logJson({ event: 'watchModeStart' });
return;
}
this.log(this.format('\n👀 Watch Mode', 'cyan'));
this.log(this.format(' Running tests in watch mode...', 'dim'));
this.log(this.format(' Press Ctrl+C to exit\n', 'dim'));
}
watchModeWaiting() {
if (this.options.json) {
this.logJson({ event: 'watchModeWaiting' });
return;
}
this.log(this.format('\n Waiting for file changes...', 'dim'));
}
watchModeRerun(changedFiles: string[]) {
if (this.options.json) {
this.logJson({ event: 'watchModeRerun', changedFiles });
return;
}
this.log(this.format('\n🔄 File changes detected:', 'cyan'));
changedFiles.forEach(file => {
this.log(this.format(`${file}`, 'yellow'));
});
this.log(this.format('\n Re-running tests...\n', 'dim'));
}
watchModeStop() {
if (this.options.json) {
this.logJson({ event: 'watchModeStop' });
return;
}
this.log(this.format('\n\n👋 Stopping watch mode...', 'cyan'));
}
}