fix NextConfig detection in createTestDir (#67609)
We were creating a `next.config.js` file which conflicts with an
existing `next.config.ts` file, since the next config detection wasn't
properly looking at files in the test dir.
[x-ref](https://github.com/vercel/next.js/actions/runs/9862195913/job/27233838936)