(
urls: PluginUrls,
options: AxePluginOptions = {},
)
| 19 | * @returns Plugin configuration |
| 20 | */ |
| 21 | export function axePlugin( |
| 22 | urls: PluginUrls, |
| 23 | options: AxePluginOptions = {}, |
| 24 | ): PluginConfig { |
| 25 | const { preset, scoreTargets, timeout, setupScript } = validate( |
| 26 | axePluginOptionsSchema, |
| 27 | options, |
| 28 | ); |
| 29 | |
| 30 | const { urls: normalizedUrls, context } = normalizeUrlInput(urls); |
| 31 | |
| 32 | const { audits, groups, ruleIds } = processAuditsAndGroups( |
| 33 | normalizedUrls, |
| 34 | preset, |
| 35 | ); |
| 36 | |
| 37 | const packageJson = createRequire(import.meta.url)( |
| 38 | '../../package.json', |
| 39 | ) as typeof import('../../package.json'); |
| 40 | |
| 41 | return { |
| 42 | slug: AXE_PLUGIN_SLUG, |
| 43 | title: AXE_PLUGIN_TITLE, |
| 44 | icon: 'folder-syntax', |
| 45 | description: |
| 46 | 'Official Code PushUp Axe plugin for automated accessibility testing', |
| 47 | docsUrl: 'https://www.npmjs.com/package/@code-pushup/axe-plugin', |
| 48 | packageName: packageJson.name, |
| 49 | version: packageJson.version, |
| 50 | audits, |
| 51 | groups, |
| 52 | runner: createRunnerFunction(normalizedUrls, ruleIds, timeout, setupScript), |
| 53 | context, |
| 54 | ...(scoreTargets && { scoreTargets }), |
| 55 | }; |
| 56 | } |
no test coverage detected