(
runCommand: (command: string[]) => Promise<{ success: boolean; output: string }>,
axePath: string | undefined,
)
| 286 | } |
| 287 | |
| 288 | export async function getAxeVersionMetadata( |
| 289 | runCommand: (command: string[]) => Promise<{ success: boolean; output: string }>, |
| 290 | axePath: string | undefined, |
| 291 | ): Promise<string | undefined> { |
| 292 | if (!axePath) { |
| 293 | return undefined; |
| 294 | } |
| 295 | |
| 296 | try { |
| 297 | const result = await runCommand([axePath, '--version']); |
| 298 | if (!result.success) { |
| 299 | return undefined; |
| 300 | } |
| 301 | const versionLine = result.output.trim().split('\n')[0]?.trim(); |
| 302 | return versionLine || undefined; |
| 303 | } catch { |
| 304 | return undefined; |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | export function initSentry(context?: Pick<SentryRuntimeContext, 'mode'>): void { |
| 309 | if (initialized || isSentryDisabled() || isTestEnv()) { |
no test coverage detected