(from: string, moduleName: string)
| 151 | } |
| 152 | |
| 153 | private computeManualMock(from: string, moduleName: string): string | null { |
| 154 | if (this.isCoreModule(moduleName)) { |
| 155 | return this.getCjsMockModule(from, moduleName); |
| 156 | } |
| 157 | |
| 158 | const rootMock = this.getCjsMockModule(from, moduleName); |
| 159 | if (rootMock) return rootMock; |
| 160 | |
| 161 | const modulePath = this.resolveCjs(from, moduleName); |
| 162 | const sibling = path.join( |
| 163 | path.dirname(modulePath), |
| 164 | '__mocks__', |
| 165 | path.basename(modulePath), |
| 166 | ); |
| 167 | return fs.existsSync(sibling) ? sibling : null; |
| 168 | } |
| 169 | |
| 170 | resolveCjsStub(from: string, moduleName: string): string | null { |
| 171 | return this.resolver.resolveStubModuleName(from, moduleName, { |
no test coverage detected