The key point was to replace fetch-mock, which works with jest, with vitest mocking. But I also found combining the two tests into one to be easier to reason about (and debug until the finish).
I ran npm i to update lockfile after removing fetch-mock but it seems to have had a very dramatic effect, hope it didn't bring back any CVEs but not sure how to do better...
Fixes #3724
The key point was to replace fetch-mock, which works with jest, with vitest mocking. But I also found combining the two tests into one to be easier to reason about (and debug until the finish).
I ran
npm i
to update lockfile after removing fetch-mock but it seems to have had a very dramatic effect, hope it didn't bring back any CVEs but not sure how to do better...