(tmpDirPath: string)
| 119 | } |
| 120 | |
| 121 | export function setupBazelTo(tmpDirPath: string) { |
| 122 | const nodeModulesPath = path.join(tmpDirPath, 'node_modules'); |
| 123 | const angularDirectory = path.join(nodeModulesPath, '@angular'); |
| 124 | |
| 125 | fs.mkdirSync(nodeModulesPath); |
| 126 | fs.mkdirSync(angularDirectory); |
| 127 | |
| 128 | getAngularPackagesFromRunfiles().forEach(({pkgPath, name}) => { |
| 129 | fs.symlinkSync(pkgPath, path.join(angularDirectory, name), 'junction'); |
| 130 | }); |
| 131 | |
| 132 | // Link typescript |
| 133 | const typeScriptSource = resolveFromRunfiles('_main/node_modules/typescript'); |
| 134 | const typescriptDest = path.join(nodeModulesPath, 'typescript'); |
| 135 | fs.symlinkSync(typeScriptSource, typescriptDest, 'junction'); |
| 136 | |
| 137 | // Link "rxjs" if it has been set up as a runfile. "rxjs" is linked optionally because |
| 138 | // not all compiler-cli tests need "rxjs" set up. |
| 139 | try { |
| 140 | const rxjsSource = resolveFromRunfiles('_main/node_modules/rxjs'); |
| 141 | const rxjsDest = path.join(nodeModulesPath, 'rxjs'); |
| 142 | fs.symlinkSync(rxjsSource, rxjsDest, 'junction'); |
| 143 | } catch (e: any) { |
| 144 | if (e.code !== 'MODULE_NOT_FOUND') throw e; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | export function setup(): TestSupport { |
| 149 | // // `TestSupport` provides its own file-system abstraction so we just use |
no test coverage detected
searching dependent graphs…