Best practice for automated tests?

Ive made a pretty big vibe coded app but hitting the wall and each thing i do creates more problems. Whats the best way to setup tests so the ai can see its broke and fix it automatically?