fix: pass modulePath instead of moduleName to onGenerateMock callback (#15429) #14414
Annotations
7 errors and 2 warnings
run tests:
undefined#L1
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: StringMatching /\/test_root\/RegularModule\.js$/, Anything
Received: "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", {"filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "getModuleStateValue": [Function getModuleStateValue], "isLoaded": [Function mockConstructor], "isRealModule": true, "jest": {"advanceTimersByTime": [Function advanceTimersByTime], "advanceTimersByTimeAsync": [Function advanceTimersByTimeAsync], "advanceTimersToNextFrame": [Function advanceTimersToNextFrame], "advanceTimersToNextTimer": [Function advanceTimersToNextTimer], "advanceTimersToNextTimerAsync": [Function advanceTimersToNextTimerAsync], "autoMockOff": [Function disableAutomock], "autoMockOn": [Function enableAutomock], "clearAllMocks": [Function clearAllMocks], "clearAllTimers": [Function clearAllTimers], "createMockFromModule": [Function createMockFromModule], "deepUnmock": [Function deepUnmock], "disableAutomock": [Function disableAutomock], "doMock": [Function mock], "dontMock": [Function unmock], "enableAutomock": [Function enableAutomock], "fn": [Function bound fn], "getRealSystemTime": [Function getRealSystemTime], "getSeed": [Function getSeed], "getTimerCount": [Function getTimerCount], "isEnvironmentTornDown": [Function isEnvironmentTornDown], "isMockFunction": [Function isMockFunction], "isolateModules": [Function isolateModules], "isolateModulesAsync": [Function bound isolateModulesAsync], "mock": [Function mock], "mocked": [Function bound mocked], "now": [Function now], "onGenerateMock": [Function onGenerateMock], "replaceProperty": [Function bound replaceProperty], "requireActual": [Function requireActual], "requireMock": [Function requireMock], "resetAllMocks": [Function resetAllMocks], "resetModules": [Function resetModules], "restoreAllMocks": [Function restoreAllMocks], "retryTimes": [Function retryTimes], "runAllImmediates": [Function runAllImmediates], "runAllTicks": [Function runAllTicks], "runAllTimers": [Function runAllTimers], "runAllTimersAsync": [Function runAllTimersAsync], "runOnlyPendingTimers": [Function runOnlyPendingTimers], "runOnlyPendingTimersAsync": [Function runOnlyPendingTimersAsync], "setMock": [Function setMock], "setSystemTime": [Function setSystemTime], "setTimeout": [Function setTimeout], "spyOn": [Function bound spyOn], "unmock": [Function unmock], "unstable_mockModule": [Function mockModule], "unstable_unmockModule": [Function unmockModule], "useFakeTimers": [Function useFakeTimers], "useRealTimers": [Function useRealTimers]}, "lazyRequire": [Function lazyRequire], "loaded": false, "module": {"children": [], "exports": [Circular], "filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "id": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "isPreloading": false, "loaded": true, "main": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "require": [Function bound requireModuleOrMock]}, "object": {}, "parent": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "setModuleStateValue": [Function setModuleStateValue]}
Number of calls: 1
at Object.toHaveBeenCalledWith (packages/jest-runtime/src/__tests__/runtime_mock.test.js:157:30)
|
run tests:
undefined#L1
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: StringMatching /\/test_root\/RegularModule\.js$/, Anything
Received: "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", {"filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "getModuleStateValue": [Function getModuleStateValue], "isLoaded": [Function mockConstructor], "isRealModule": true, "jest": {"advanceTimersByTime": [Function advanceTimersByTime], "advanceTimersByTimeAsync": [Function advanceTimersByTimeAsync], "advanceTimersToNextFrame": [Function advanceTimersToNextFrame], "advanceTimersToNextTimer": [Function advanceTimersToNextTimer], "advanceTimersToNextTimerAsync": [Function advanceTimersToNextTimerAsync], "autoMockOff": [Function disableAutomock], "autoMockOn": [Function enableAutomock], "clearAllMocks": [Function clearAllMocks], "clearAllTimers": [Function clearAllTimers], "createMockFromModule": [Function createMockFromModule], "deepUnmock": [Function deepUnmock], "disableAutomock": [Function disableAutomock], "doMock": [Function mock], "dontMock": [Function unmock], "enableAutomock": [Function enableAutomock], "fn": [Function bound fn], "getRealSystemTime": [Function getRealSystemTime], "getSeed": [Function getSeed], "getTimerCount": [Function getTimerCount], "isEnvironmentTornDown": [Function isEnvironmentTornDown], "isMockFunction": [Function isMockFunction], "isolateModules": [Function isolateModules], "isolateModulesAsync": [Function bound isolateModulesAsync], "mock": [Function mock], "mocked": [Function bound mocked], "now": [Function now], "onGenerateMock": [Function onGenerateMock], "replaceProperty": [Function bound replaceProperty], "requireActual": [Function requireActual], "requireMock": [Function requireMock], "resetAllMocks": [Function resetAllMocks], "resetModules": [Function resetModules], "restoreAllMocks": [Function restoreAllMocks], "retryTimes": [Function retryTimes], "runAllImmediates": [Function runAllImmediates], "runAllTicks": [Function runAllTicks], "runAllTimers": [Function runAllTimers], "runAllTimersAsync": [Function runAllTimersAsync], "runOnlyPendingTimers": [Function runOnlyPendingTimers], "runOnlyPendingTimersAsync": [Function runOnlyPendingTimersAsync], "setMock": [Function setMock], "setSystemTime": [Function setSystemTime], "setTimeout": [Function setTimeout], "spyOn": [Function bound spyOn], "unmock": [Function unmock], "unstable_mockModule": [Function mockModule], "unstable_unmockModule": [Function unmockModule], "useFakeTimers": [Function useFakeTimers], "useRealTimers": [Function useRealTimers]}, "lazyRequire": [Function lazyRequire], "loaded": false, "module": {"children": [], "exports": [Circular], "filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "id": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "isPreloading": false, "loaded": true, "main": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "require": [Function bound requireModuleOrMock]}, "object": {}, "parent": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "setModuleStateValue": [Function setModuleStateValue]}
Number of calls: 1
at Object.toHaveBeenCalledWith (packages/jest-runtime/src/__tests__/runtime_mock.test.js:203:31)
|
run tests:
undefined#L1
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: StringMatching /\/test_root\/RegularModule\.js$/, Anything
Received: "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", {"filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "getModuleStateValue": [Function getModuleStateValue], "isLoaded": [Function mockConstructor], "isRealModule": true, "jest": {"advanceTimersByTime": [Function advanceTimersByTime], "advanceTimersByTimeAsync": [Function advanceTimersByTimeAsync], "advanceTimersToNextFrame": [Function advanceTimersToNextFrame], "advanceTimersToNextTimer": [Function advanceTimersToNextTimer], "advanceTimersToNextTimerAsync": [Function advanceTimersToNextTimerAsync], "autoMockOff": [Function disableAutomock], "autoMockOn": [Function enableAutomock], "clearAllMocks": [Function clearAllMocks], "clearAllTimers": [Function clearAllTimers], "createMockFromModule": [Function createMockFromModule], "deepUnmock": [Function deepUnmock], "disableAutomock": [Function disableAutomock], "doMock": [Function mock], "dontMock": [Function unmock], "enableAutomock": [Function enableAutomock], "fn": [Function bound fn], "getRealSystemTime": [Function getRealSystemTime], "getSeed": [Function getSeed], "getTimerCount": [Function getTimerCount], "isEnvironmentTornDown": [Function isEnvironmentTornDown], "isMockFunction": [Function isMockFunction], "isolateModules": [Function isolateModules], "isolateModulesAsync": [Function bound isolateModulesAsync], "mock": [Function mock], "mocked": [Function bound mocked], "now": [Function now], "onGenerateMock": [Function onGenerateMock], "replaceProperty": [Function bound replaceProperty], "requireActual": [Function requireActual], "requireMock": [Function requireMock], "resetAllMocks": [Function resetAllMocks], "resetModules": [Function resetModules], "restoreAllMocks": [Function restoreAllMocks], "retryTimes": [Function retryTimes], "runAllImmediates": [Function runAllImmediates], "runAllTicks": [Function runAllTicks], "runAllTimers": [Function runAllTimers], "runAllTimersAsync": [Function runAllTimersAsync], "runOnlyPendingTimers": [Function runOnlyPendingTimers], "runOnlyPendingTimersAsync": [Function runOnlyPendingTimersAsync], "setMock": [Function setMock], "setSystemTime": [Function setSystemTime], "setTimeout": [Function setTimeout], "spyOn": [Function bound spyOn], "unmock": [Function unmock], "unstable_mockModule": [Function mockModule], "unstable_unmockModule": [Function unmockModule], "useFakeTimers": [Function useFakeTimers], "useRealTimers": [Function useRealTimers]}, "lazyRequire": [Function lazyRequire], "loaded": false, "module": {"children": [], "exports": [Circular], "filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "id": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "isPreloading": false, "loaded": true, "main": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "require": [Function bound requireModuleOrMock]}, "object": {}, "parent": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "setModuleStateValue": [Function setModuleStateValue]}
Number of calls: 1
at Object.toHaveBeenCalledWith (packages/jest-runtime/src/__tests__/runtime_mock.test.js:157:30)
|
run tests:
undefined#L1
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: StringMatching /\/test_root\/RegularModule\.js$/, Anything
Received: "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", {"filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "getModuleStateValue": [Function getModuleStateValue], "isLoaded": [Function mockConstructor], "isRealModule": true, "jest": {"advanceTimersByTime": [Function advanceTimersByTime], "advanceTimersByTimeAsync": [Function advanceTimersByTimeAsync], "advanceTimersToNextFrame": [Function advanceTimersToNextFrame], "advanceTimersToNextTimer": [Function advanceTimersToNextTimer], "advanceTimersToNextTimerAsync": [Function advanceTimersToNextTimerAsync], "autoMockOff": [Function disableAutomock], "autoMockOn": [Function enableAutomock], "clearAllMocks": [Function clearAllMocks], "clearAllTimers": [Function clearAllTimers], "createMockFromModule": [Function createMockFromModule], "deepUnmock": [Function deepUnmock], "disableAutomock": [Function disableAutomock], "doMock": [Function mock], "dontMock": [Function unmock], "enableAutomock": [Function enableAutomock], "fn": [Function bound fn], "getRealSystemTime": [Function getRealSystemTime], "getSeed": [Function getSeed], "getTimerCount": [Function getTimerCount], "isEnvironmentTornDown": [Function isEnvironmentTornDown], "isMockFunction": [Function isMockFunction], "isolateModules": [Function isolateModules], "isolateModulesAsync": [Function bound isolateModulesAsync], "mock": [Function mock], "mocked": [Function bound mocked], "now": [Function now], "onGenerateMock": [Function onGenerateMock], "replaceProperty": [Function bound replaceProperty], "requireActual": [Function requireActual], "requireMock": [Function requireMock], "resetAllMocks": [Function resetAllMocks], "resetModules": [Function resetModules], "restoreAllMocks": [Function restoreAllMocks], "retryTimes": [Function retryTimes], "runAllImmediates": [Function runAllImmediates], "runAllTicks": [Function runAllTicks], "runAllTimers": [Function runAllTimers], "runAllTimersAsync": [Function runAllTimersAsync], "runOnlyPendingTimers": [Function runOnlyPendingTimers], "runOnlyPendingTimersAsync": [Function runOnlyPendingTimersAsync], "setMock": [Function setMock], "setSystemTime": [Function setSystemTime], "setTimeout": [Function setTimeout], "spyOn": [Function bound spyOn], "unmock": [Function unmock], "unstable_mockModule": [Function mockModule], "unstable_unmockModule": [Function unmockModule], "useFakeTimers": [Function useFakeTimers], "useRealTimers": [Function useRealTimers]}, "lazyRequire": [Function lazyRequire], "loaded": false, "module": {"children": [], "exports": [Circular], "filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "id": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "isPreloading": false, "loaded": true, "main": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "require": [Function bound requireModuleOrMock]}, "object": {}, "parent": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "setModuleStateValue": [Function setModuleStateValue]}
Number of calls: 1
at Object.toHaveBeenCalledWith (packages/jest-runtime/src/__tests__/runtime_mock.test.js:203:31)
|
run tests:
undefined#L1
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: StringMatching /\/test_root\/RegularModule\.js$/, Anything
Received: "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", {"filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "getModuleStateValue": [Function getModuleStateValue], "isLoaded": [Function mockConstructor], "isRealModule": true, "jest": {"advanceTimersByTime": [Function advanceTimersByTime], "advanceTimersByTimeAsync": [Function advanceTimersByTimeAsync], "advanceTimersToNextFrame": [Function advanceTimersToNextFrame], "advanceTimersToNextTimer": [Function advanceTimersToNextTimer], "advanceTimersToNextTimerAsync": [Function advanceTimersToNextTimerAsync], "autoMockOff": [Function disableAutomock], "autoMockOn": [Function enableAutomock], "clearAllMocks": [Function clearAllMocks], "clearAllTimers": [Function clearAllTimers], "createMockFromModule": [Function createMockFromModule], "deepUnmock": [Function deepUnmock], "disableAutomock": [Function disableAutomock], "doMock": [Function mock], "dontMock": [Function unmock], "enableAutomock": [Function enableAutomock], "fn": [Function bound fn], "getRealSystemTime": [Function getRealSystemTime], "getSeed": [Function getSeed], "getTimerCount": [Function getTimerCount], "isEnvironmentTornDown": [Function isEnvironmentTornDown], "isMockFunction": [Function isMockFunction], "isolateModules": [Function isolateModules], "isolateModulesAsync": [Function bound isolateModulesAsync], "mock": [Function mock], "mocked": [Function bound mocked], "now": [Function now], "onGenerateMock": [Function onGenerateMock], "replaceProperty": [Function bound replaceProperty], "requireActual": [Function requireActual], "requireMock": [Function requireMock], "resetAllMocks": [Function resetAllMocks], "resetModules": [Function resetModules], "restoreAllMocks": [Function restoreAllMocks], "retryTimes": [Function retryTimes], "runAllImmediates": [Function runAllImmediates], "runAllTicks": [Function runAllTicks], "runAllTimers": [Function runAllTimers], "runAllTimersAsync": [Function runAllTimersAsync], "runOnlyPendingTimers": [Function runOnlyPendingTimers], "runOnlyPendingTimersAsync": [Function runOnlyPendingTimersAsync], "setMock": [Function setMock], "setSystemTime": [Function setSystemTime], "setTimeout": [Function setTimeout], "spyOn": [Function bound spyOn], "unmock": [Function unmock], "unstable_mockModule": [Function mockModule], "unstable_unmockModule": [Function unmockModule], "useFakeTimers": [Function useFakeTimers], "useRealTimers": [Function useRealTimers]}, "lazyRequire": [Function lazyRequire], "loaded": false, "module": {"children": [], "exports": [Circular], "filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "id": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "isPreloading": false, "loaded": true, "main": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "require": [Function bound requireModuleOrMock]}, "object": {}, "parent": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "setModuleStateValue": [Function setModuleStateValue]}
Number of calls: 1
at Object.toHaveBeenCalledWith (packages/jest-runtime/src/__tests__/runtime_mock.test.js:157:30)
|
run tests:
undefined#L1
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: StringMatching /\/test_root\/RegularModule\.js$/, Anything
Received: "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", {"filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "getModuleStateValue": [Function getModuleStateValue], "isLoaded": [Function mockConstructor], "isRealModule": true, "jest": {"advanceTimersByTime": [Function advanceTimersByTime], "advanceTimersByTimeAsync": [Function advanceTimersByTimeAsync], "advanceTimersToNextFrame": [Function advanceTimersToNextFrame], "advanceTimersToNextTimer": [Function advanceTimersToNextTimer], "advanceTimersToNextTimerAsync": [Function advanceTimersToNextTimerAsync], "autoMockOff": [Function disableAutomock], "autoMockOn": [Function enableAutomock], "clearAllMocks": [Function clearAllMocks], "clearAllTimers": [Function clearAllTimers], "createMockFromModule": [Function createMockFromModule], "deepUnmock": [Function deepUnmock], "disableAutomock": [Function disableAutomock], "doMock": [Function mock], "dontMock": [Function unmock], "enableAutomock": [Function enableAutomock], "fn": [Function bound fn], "getRealSystemTime": [Function getRealSystemTime], "getSeed": [Function getSeed], "getTimerCount": [Function getTimerCount], "isEnvironmentTornDown": [Function isEnvironmentTornDown], "isMockFunction": [Function isMockFunction], "isolateModules": [Function isolateModules], "isolateModulesAsync": [Function bound isolateModulesAsync], "mock": [Function mock], "mocked": [Function bound mocked], "now": [Function now], "onGenerateMock": [Function onGenerateMock], "replaceProperty": [Function bound replaceProperty], "requireActual": [Function requireActual], "requireMock": [Function requireMock], "resetAllMocks": [Function resetAllMocks], "resetModules": [Function resetModules], "restoreAllMocks": [Function restoreAllMocks], "retryTimes": [Function retryTimes], "runAllImmediates": [Function runAllImmediates], "runAllTicks": [Function runAllTicks], "runAllTimers": [Function runAllTimers], "runAllTimersAsync": [Function runAllTimersAsync], "runOnlyPendingTimers": [Function runOnlyPendingTimers], "runOnlyPendingTimersAsync": [Function runOnlyPendingTimersAsync], "setMock": [Function setMock], "setSystemTime": [Function setSystemTime], "setTimeout": [Function setTimeout], "spyOn": [Function bound spyOn], "unmock": [Function unmock], "unstable_mockModule": [Function mockModule], "unstable_unmockModule": [Function unmockModule], "useFakeTimers": [Function useFakeTimers], "useRealTimers": [Function useRealTimers]}, "lazyRequire": [Function lazyRequire], "loaded": false, "module": {"children": [], "exports": [Circular], "filename": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "id": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root\\RegularModule.js", "isPreloading": false, "loaded": true, "main": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "require": [Function bound requireModuleOrMock]}, "object": {}, "parent": null, "path": "D:\\a\\jest\\jest\\packages\\jest-runtime\\src\\__tests__\\test_root", "paths": [], "setModuleStateValue": [Function setModuleStateValue]}
Number of calls: 1
at Object.toHaveBeenCalledWith (packages/jest-runtime/src/__tests__/runtime_mock.test.js:203:31)
|
run tests
Final attempt failed. Child_process exited with error code 1
|
run tests
Attempt 1 failed. Reason: Child_process exited with error code 1
|
run tests
Attempt 2 failed. Reason: Child_process exited with error code 1
|
Loading