| 35 | const TSTestsPath = path.join(dirname, "../../../build/typescript/tests"); |
| 36 | |
| 37 | function generateTSBaselineErrorMap() { |
| 38 | const errorMap = new Map(); |
| 39 | const baselineDir = path.join(TSTestsPath, "baselines/reference"); |
| 40 | for (const filename of fs.readdirSync(baselineDir)) { |
| 41 | if (filename.endsWith(".errors.txt")) { |
| 42 | const testBasenameWithoutOptions = filename |
| 43 | .slice(0, -".errors.txt".length) |
| 44 | .replace(/\(\S+\)$/, ""); |
| 45 | errorMap.set(testBasenameWithoutOptions, filename); |
| 46 | } |
| 47 | } |
| 48 | return errorMap; |
| 49 | } |
| 50 | |
| 51 | const TSBaselineErrorMap = generateTSBaselineErrorMap(); |
| 52 | |