@allurereport/core-api
Advanced tools
@@ -8,2 +8,6 @@ import type { Statistic } from "./aggregate.js"; | ||
| export declare const TRANSITION_ORDER: Record<string, number>; | ||
| export declare const DEFAULT_ERROR_CATEGORY_IDS: { | ||
| readonly productErrors: "_product_errors_default_category"; | ||
| readonly testErrors: "_test_errors_default_category"; | ||
| }; | ||
| export declare const DEFAULT_ERROR_CATEGORIES: CategoryRule[]; | ||
@@ -10,0 +14,0 @@ export type TestCategories = { |
+13
-2
@@ -22,4 +22,9 @@ export const EMPTY_VALUE = "<Empty>"; | ||
| }; | ||
| export const DEFAULT_ERROR_CATEGORY_IDS = { | ||
| productErrors: "_product_errors_default_category", | ||
| testErrors: "_test_errors_default_category", | ||
| }; | ||
| export const DEFAULT_ERROR_CATEGORIES = [ | ||
| { | ||
| id: DEFAULT_ERROR_CATEGORY_IDS.productErrors, | ||
| name: "Product errors", | ||
@@ -29,2 +34,3 @@ matchers: { statuses: ["failed"] }, | ||
| { | ||
| id: DEFAULT_ERROR_CATEGORY_IDS.testErrors, | ||
| name: "Test errors", | ||
@@ -120,3 +126,8 @@ matchers: { statuses: ["broken"] }, | ||
| } | ||
| const idValidationResult = normalizeCategoryId(rule.id ?? rule.name); | ||
| const defaultIdByName = new Map([ | ||
| ["Product errors", DEFAULT_ERROR_CATEGORY_IDS.productErrors], | ||
| ["Test errors", DEFAULT_ERROR_CATEGORY_IDS.testErrors], | ||
| ]); | ||
| const effectiveId = rule.id ?? defaultIdByName.get(rule.name) ?? rule.name; | ||
| const idValidationResult = normalizeCategoryId(effectiveId); | ||
| if (!idValidationResult.valid) { | ||
@@ -127,3 +138,3 @@ throw new Error(`categories[${index}].id ${idValidationResult.reason}`); | ||
| const sourceIds = sourceIdsByNormalizedId.get(normalizedId) ?? new Set(); | ||
| sourceIds.add(rule.id ?? rule.name); | ||
| sourceIds.add(effectiveId); | ||
| sourceIdsByNormalizedId.set(normalizedId, sourceIds); | ||
@@ -130,0 +141,0 @@ const matchers = normalizeMatchers(rule, index); |
+1
-1
| { | ||
| "name": "@allurereport/core-api", | ||
| "version": "3.6.0", | ||
| "version": "3.6.1", | ||
| "description": "Allure Core API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
51812
1.36%1369
1.11%