[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

docs: Updating migration guide file (jest -> vitest) for server.deps.inline property (#5612)

authored by

Paul Rosset and committed by
GitHub
(May 1, 2024, 1:26 PM +0200) 4b7f7f5f bfe8ad9d

+8
+8
docs/guide/migration.md
··· 186 186 const { cloneDeep } = await vi.importActual('lodash/cloneDeep') // [!code ++] 187 187 ``` 188 188 189 + ### Extends mocking to external libraries 190 + 191 + Where Jest does it by default, when mocking a module and wanting this mocking to be extended to other external libraries that use the same module, you should explicitly tell which 3rd-party library you want to be mocked, so the external library would be part of your source code, by using [server.deps.inline](https://vitest.dev/config/#server-deps-inline). 192 + 193 + ``` 194 + server.deps.inline: ["lib-name"] 195 + ``` 196 + 189 197 ### Accessing the Return Values of a Mocked Promise 190 198 191 199 Both Jest and Vitest store the results of all mock calls in the [`mock.results`](/api/mock.html#mock-results) array, where the return values of each call are stored in the `value` property.