| 41 | const sanitize = (name) => name.replace(/[^a-zA-Z0-9._-]/g, "-") |
| 42 | |
| 43 | const writeTempTsconfig = (suiteName, subjectName, sourcePath) => { |
| 44 | mkdirSync(tmpDir, { recursive: true }) |
| 45 | const id = sanitize(`${suiteName}-${subjectName}`) |
| 46 | const tsconfigPath = join(tmpDir, `${id}.json`) |
| 47 | const tsBuildInfoPath = join(tmpDir, `${id}.tsbuildinfo`) |
| 48 | writeJson(tsconfigPath, { |
| 49 | extends: effectTsconfigPath, |
| 50 | files: [sourcePath], |
| 51 | include: [], |
| 52 | compilerOptions: { |
| 53 | noEmit: true, |
| 54 | declaration: false, |
| 55 | declarationMap: false, |
| 56 | sourceMap: false, |
| 57 | plugins: [], |
| 58 | rootDir: effectDir, |
| 59 | incremental: false, |
| 60 | composite: false, |
| 61 | tsBuildInfoFile: tsBuildInfoPath |
| 62 | } |
| 63 | }) |
| 64 | return tsconfigPath |
| 65 | } |
| 66 | |
| 67 | const readMetric = (output, label, metric) => { |
| 68 | const match = output.match(new RegExp(`^${metric}:\\s+(\\d+)$`, "m")) |