()
| 139 | * Get environment variables needed for bundled AXe to run |
| 140 | */ |
| 141 | export function getBundledAxeEnvironment(): Record<string, string> { |
| 142 | const resolved = resolveAxeBinary(); |
| 143 | if (resolved?.source !== 'bundled') { |
| 144 | return {}; |
| 145 | } |
| 146 | |
| 147 | const frameworksDir = getBundledFrameworksDir(); |
| 148 | if (!existsSync(frameworksDir)) { |
| 149 | return {}; |
| 150 | } |
| 151 | |
| 152 | const currentFrameworkPath = process.env.DYLD_FRAMEWORK_PATH; |
| 153 | const frameworkPath = currentFrameworkPath |
| 154 | ? `${frameworksDir}${delimiter}${currentFrameworkPath}` |
| 155 | : frameworksDir; |
| 156 | |
| 157 | return { DYLD_FRAMEWORK_PATH: frameworkPath }; |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * Check if axe tool is available (bundled, env override, or PATH) |
no test coverage detected