sonukapoor/warpdom is a DOM implementation for unit tests. The repository description states that it "loads almost instantly and behaves like jsdom, Node's browser DOM implementation." On November 2, 2026, commit 79d0d92 merged PR #236. In fast mode, the criterion for restoring mocks created by setup files when resetting between test files changed. Previously it compared the property descriptors (getter and setter) of members to pick the restoration targets, and now it tracks each key from the first mock through the cleanup that ends the last mock and restores the original value. This is a change that addresses issue #230.
The judging criterion has moved from "what to restore" to "when it ended." `warpdom/vitest/reset` wraps `vi.stubGlobal`, `vi.spyOn`, `vi.unstubAllGlobals`, `vi.restoreAllMocks`, and each spy's `mockRestore`, recording the value immediately before the first mock replaced it as the original. It restores with that original regardless of how the getter and setter changed in between. There was a problem whereby, if Vitest's cleanup or a test released the stub created by a setup file, the previous stub value would become fixed as the original when the next file's setup stubbed the same member again, and this approach prevents that situation. The document fast-mode.md states that the problem in Vitest 4 and 5, where `vi.restoreAllMocks` spies on both the getter and the setter and then leaves the getter spy in place (measured versions 4.1.12, 5.0.3), was also changed to restore the original. This commit is a 425-line change (+327/-98) spanning 10 files, including the documentation, src/vitest-reset.js, src/vitest.js, the fixtures/vitest-fast fixture, and test/vitest-adapter.test.js.
That said, the scope is fast mode. In Vitest 3, the problem remains that `vi.restoreAllMocks` returns an already `mockRestore()`-ed spy to its previous value again (measured version 3.2.4, without warpdom), and the documentation explicitly marks this as "not covered." Globals set by modules that are loaded only once per worker (polyfills, etc.) and values changed by tests such as `global.fetch = vi.fn()` are not restoration targets. No separate performance figures or benchmark results are included in this commit, so the actual magnitude of improvement is hard to judge from the commit alone. The source is commit 79d0d92 on GitHub.