Function
clearModuleMocks
(config: SerializedConfig)
Source from the content-addressed store, hash-verified
| 291 | } |
| 292 | |
| 293 | function clearModuleMocks(config: SerializedConfig) { |
| 294 | const { clearMocks, mockReset, restoreMocks, unstubEnvs, unstubGlobals } |
| 295 | = config |
| 296 | |
| 297 | if (restoreMocks) { |
| 298 | vi.restoreAllMocks() |
| 299 | } |
| 300 | if (mockReset) { |
| 301 | vi.resetAllMocks() |
| 302 | } |
| 303 | if (clearMocks) { |
| 304 | vi.clearAllMocks() |
| 305 | } |
| 306 | |
| 307 | if (unstubEnvs) { |
| 308 | vi.unstubAllEnvs() |
| 309 | } |
| 310 | if (unstubGlobals) { |
| 311 | vi.unstubAllGlobals() |
| 312 | } |
| 313 | } |
Tested by
no test coverage detected