Consider switching from jest to vitest
it should speed up test runs a fair bit, and simplify the DX for us
jest is a bit clunky these days and heavyweight. we can make a branch and compare, if needed though.
As I understand, the CLI test heavily relay on child process, the Jest part only do assertion, not really important, also Prettier currently still runs on Jest, stay with Jest maybe a better choice, so it will be easier when we merge code into core.
that's a fair point
we would probably need to move prettier to vitest first
i think that's the only thing preventing us from doing it. the process stuff should still be fine in theory, but would need some testing
let's leave this for now then 👍
I thought about it before, my concern is transforming, I don't want the test lib to do transforming which can potentially hide bugs. I haven't check how vitest works, but I assume it also supports transform: {} like Jest.
I hope to move to node --test directly someday. There are already several repos using Vitest in Prettier org.
stay with Jest maybe a better choice, so it will be easier when we merge code into core.
That's maybe the main thing to think about. Though I'm not sure switching to something else would make it significantly harder?
As I understand, the CLI test heavily relay on child process, the Jest part only do assertion, not really important
The speedup would come from parallelizing test() calls within a file, which as I understand it currently isn't the case in Jest (?) and there's no option to enable it. Maybe Vite doesn't support this either, but whatever we may switch to should support that or there isn't much speedup to be gained I think.