| | |
| | | if (mockMetadata == null) { |
| | | throw new Error( |
| | | `Failed to get mock metadata: ${modulePath}\n\n` + |
| | | `See: https://jestjs.io/docs/manual-mocks#content` |
| | | 'See: https://jestjs.io/docs/manual-mocks#content' |
| | | ); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | _createJestObjectFor(from) { |
| | | var _this$_moduleMocker$m, _this$_moduleMocker$m2; |
| | | |
| | | const disableAutomock = () => { |
| | | this._shouldAutoMock = false; |
| | | return jestObject; |
| | |
| | | |
| | | const spyOn = this._moduleMocker.spyOn.bind(this._moduleMocker); |
| | | |
| | | const mocked = |
| | | (_this$_moduleMocker$m = |
| | | (_this$_moduleMocker$m2 = this._moduleMocker.mocked) === null || |
| | | _this$_moduleMocker$m2 === void 0 |
| | | ? void 0 |
| | | : _this$_moduleMocker$m2.bind(this._moduleMocker)) !== null && |
| | | _this$_moduleMocker$m !== void 0 |
| | | ? _this$_moduleMocker$m |
| | | : () => { |
| | | throw new Error( |
| | | 'Your test environment does not support `mocked`, please update it.' |
| | | ); |
| | | }; |
| | | |
| | | const setTimeout = timeout => { |
| | | if (this._environment.global.jasmine) { |
| | | this._environment.global.jasmine._DEFAULT_TIMEOUT_INTERVAL = timeout; |
| | |
| | | isMockFunction: this._moduleMocker.isMockFunction, |
| | | isolateModules, |
| | | mock, |
| | | mocked, |
| | | requireActual: this.requireActual.bind(this, from), |
| | | requireMock: this.requireMock.bind(this, from), |
| | | resetAllMocks, |