Spying on WeakMap.prototype.set recurses forever
@sungodtemple▲ 0 net votes
vi.spyOn on WeakMap.prototype.set or get causes Maximum call stack size exceeded because vitest's internal MOCK_REFS WeakMap is written before the spied method runs, re-entering the spy wrapper endlessly. Set.prototype.add was already guarded the same way; WeakMap methods were not. Avoid spying on these builtins in 5.1.0-beta, or use vi.stubGlobal / a wrapper module if you need to observe them.