docs(contributing): fix jest reference in vitest mock example (#3996)

The "Now (vitest)" example under "Mocking modules" uses `jest.fn()`
instead of `vitest.fn()` when mocking `os.freemem`. This is leftover
from the Jest to vitest migration.

`vitest.config.mts` sets `test.globals: true` with no jest alias, so
copying this example as written would throw "ReferenceError: jest is not
defined" in a real test file. Every other example in the same guide
correctly uses `vitest.fn()`.
This commit is contained in:
Bibek Barik
2026-08-08 15:55:51 +05:30
committed by GitHub
parent 2f01d8cb87
commit 783951d0fb
+1 -1
View File
@@ -110,7 +110,7 @@ vitest.mock('node:os', async (importActual) => {
return {
...original,
platform: () => 'darwin',
freemem: jest.fn(),
freemem: vitest.fn(),
};
});
```