MCPcopy Create free account
hub / github.com/code-pushup/cli / axeAuditRefs

Function axeAuditRefs

packages/plugin-axe/src/lib/utils.ts:79–102  ·  view source on GitHub ↗
(
  plugin: Pick<PluginConfig, 'audits' | 'context'>,
  auditSlug?: string,
  auditWeight?: number,
)

Source from the content-addressed store, hash-verified

77 * @returns Array of category refs, expanded for each URL in multi-URL configs
78 */
79export function axeAuditRefs(
80 plugin: Pick<PluginConfig, 'audits' | 'context'>,
81 auditSlug?: string,
82 auditWeight?: number,
83): CategoryRef[] {
84 const context = validate(pluginUrlContextSchema, plugin.context);
85 if (auditSlug) {
86 return expandCategoryRefs(
87 {
88 slug: auditSlug,
89 weight: auditWeight,
90 type: 'audit',
91 plugin: AXE_PLUGIN_SLUG,
92 },
93 context,
94 );
95 }
96 return plugin.audits.flatMap(({ slug }) =>
97 expandCategoryRefs(
98 { slug, type: 'audit', plugin: AXE_PLUGIN_SLUG },
99 context,
100 ),
101 );
102}
103
104function axeGroupSlugs(plugin: Pick<PluginConfig, 'groups'>): AxeGroupSlug[] {
105 if (!plugin.groups) {

Callers 1

utils.unit.test.tsFile · 0.85

Calls 2

validateFunction · 0.90
expandCategoryRefsFunction · 0.90

Tested by

no test coverage detected