( configPatterns: ConfigPatterns, project: ProjectConfig | null, )
| 493 | } |
| 494 | |
| 495 | export function configFromPatterns( |
| 496 | configPatterns: ConfigPatterns, |
| 497 | project: ProjectConfig | null, |
| 498 | ): ConfigPatterns { |
| 499 | const { persist, upload } = configPatterns; |
| 500 | const variables = { |
| 501 | projectName: project?.name ?? '', |
| 502 | }; |
| 503 | return { |
| 504 | persist: { |
| 505 | outputDir: interpolate(persist.outputDir, variables), |
| 506 | filename: interpolate(persist.filename, variables), |
| 507 | format: persist.format, |
| 508 | skipReports: persist.skipReports, |
| 509 | }, |
| 510 | ...(upload && { |
| 511 | upload: { |
| 512 | server: upload.server, |
| 513 | apiKey: upload.apiKey, |
| 514 | organization: slugify(interpolate(upload.organization, variables)), |
| 515 | project: slugify(interpolate(upload.project, variables)), |
| 516 | ...(upload.timeout != null && { timeout: upload.timeout }), |
| 517 | }, |
| 518 | }), |
| 519 | }; |
| 520 | } |
| 521 | |
| 522 | export async function findNewIssues( |
| 523 | args: CompareReportsArgs, |
no test coverage detected