( schemeContent: string, baseDir: string, fileSystemExecutor: FileSystemExecutor, )
| 188 | } |
| 189 | |
| 190 | async function parseTestPlanTargets( |
| 191 | schemeContent: string, |
| 192 | baseDir: string, |
| 193 | fileSystemExecutor: FileSystemExecutor, |
| 194 | ): Promise<ReferencedTestTarget[]> { |
| 195 | const targets: ReferencedTestTarget[] = []; |
| 196 | const matches = [...schemeContent.matchAll(/<TestPlanReference\s+reference\s*=\s*"([^"]+)"/g)]; |
| 197 | |
| 198 | for (const match of matches) { |
| 199 | const planPath = resolveContainerReference(match[1], baseDir); |
| 200 | let planContent: string; |
| 201 | try { |
| 202 | planContent = await fileSystemExecutor.readFile(planPath, 'utf8'); |
| 203 | } catch { |
| 204 | continue; |
| 205 | } |
| 206 | const planJson = JSON.parse(planContent) as { |
| 207 | testTargets?: Array<{ target?: { name?: string; containerPath?: string } }>; |
| 208 | }; |
| 209 | |
| 210 | for (const testTarget of planJson.testTargets ?? []) { |
| 211 | const target = testTarget.target; |
| 212 | if (!target?.name) { |
| 213 | continue; |
| 214 | } |
| 215 | targets.push({ |
| 216 | name: target.name, |
| 217 | containerPath: target.containerPath, |
| 218 | }); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | return targets; |
| 223 | } |
| 224 | |
| 225 | async function listDirectoryEntries( |
| 226 | directoryPath: string, |
no test coverage detected