MCPcopy
hub / github.com/jestjs/jest / notifyMockGenerated

Method notifyMockGenerated

packages/jest-runtime/src/internals/MockState.ts:389–395  ·  view source on GitHub ↗
(moduleName: string, moduleMock: T)

Source from the content-addressed store, hash-verified

387 }
388
389 notifyMockGenerated<T>(moduleName: string, moduleMock: T): T {
390 let result: unknown = moduleMock;
391 for (const callback of this.onGenerateMockCallbacks) {
392 result = callback(moduleName, result);
393 }
394 return result as T;
395 }
396
397 // `resetModules` does not touch mock state - explicit mocks, factories, and
398 // virtual marks survive a reset. Only `teardown` drops everything.

Callers 2

generateMockFunction · 0.80
MockState.test.tsFile · 0.80

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected