UNPKG

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
// 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(); });