also, what really changes the game is requiring that one write the tests _first_. Generally, I haven't had to do this with an ai - but it's an interesting idea (get it to write the test(s) first, and vet them - like I would do in real life - except only one test at a time, then the red-green-refactor dance). Writing the test first forces you to narrow down what you want to accomplish and makes you think about how, such that the prod code runs well and tests don't run like treacle.
Anyhoo, 'nuff said: my opinion is that the OP should "git gud" or accept that they will never reap the benefits of a good test suite.