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

Function axeGroupRefs

packages/plugin-axe/src/lib/utils.ts:46–69  ·  view source on GitHub ↗
(
  plugin: Pick<PluginConfig, 'groups' | 'context'>,
  groupSlug?: AxeGroupSlug,
  groupWeight?: number,
)

Source from the content-addressed store, hash-verified

44 * @returns Array of category refs, expanded for each URL in multi-URL configs
45 */
46export function axeGroupRefs(
47 plugin: Pick<PluginConfig, 'groups' | 'context'>,
48 groupSlug?: AxeGroupSlug,
49 groupWeight?: number,
50): CategoryRef[] {
51 const context = validate(pluginUrlContextSchema, plugin.context);
52 if (groupSlug) {
53 return expandCategoryRefs(
54 {
55 slug: groupSlug,
56 weight: groupWeight,
57 type: 'group',
58 plugin: AXE_PLUGIN_SLUG,
59 },
60 context,
61 );
62 }
63 return axeGroupSlugs(plugin).flatMap(slug =>
64 expandCategoryRefs(
65 { slug, type: 'group', plugin: AXE_PLUGIN_SLUG },
66 context,
67 ),
68 );
69}
70
71/**
72 * Creates category refs for Axe audits with multi-URL support.

Callers 3

configureAxePluginFunction · 0.85
createCategoriesFunction · 0.85
utils.unit.test.tsFile · 0.85

Calls 3

validateFunction · 0.90
expandCategoryRefsFunction · 0.90
axeGroupSlugsFunction · 0.85

Tested by

no test coverage detected