ripbug-ai-detector
Version:
š„ RipBug AI Bug Detector - Built by an AI that rips its own bugs. Destroy AI-generated bugs before you commit.
28 lines (22 loc) ⢠706 B
text/typescript
// watch-fixtures.ts
import { watch } from 'chokidar';
import { spawn } from 'child_process';
const watcher = watch(['src/**/*.{ts,tsx}', 'test/**/*.{ts,json}'], {
ignored: /node_modules/,
ignoreInitial: true,
});
const runTests = () => {
console.clear();
console.log('š Detected change, running fixture tests...\n');
const proc = spawn('npx', ['ts-node', 'test/run-fixture-tests.ts'], { stdio: 'inherit' });
proc.on('close', (code) => {
if (code === 0) {
console.log('\nā
All tests passed!');
} else {
console.log('\nā Some tests failed. Fix and save to rerun.');
}
});
};
watcher.on('all', (event, path) => {
runTests();
});