@allurereport/plugin-api 3.0.0-beta.6 → 3.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +2 -0
- package/dist/utils/tree.d.ts +1 -0
- package/dist/utils/tree.js +9 -0
- package/package.json +3 -3
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginDescriptor } from "./plugin.js";
|
|
2
2
|
import type { QualityGateConfig } from "./qualityGate.js";
|
|
3
|
+
export type DefaultLabelsConfig = Record<string, string | string[]>;
|
|
3
4
|
export interface Config {
|
|
4
5
|
name?: string;
|
|
5
6
|
output?: string;
|
|
@@ -7,5 +8,6 @@ export interface Config {
|
|
|
7
8
|
knownIssuesPath?: string;
|
|
8
9
|
qualityGate?: QualityGateConfig;
|
|
9
10
|
plugins?: Record<string, PluginDescriptor>;
|
|
11
|
+
defaultLabels?: DefaultLabelsConfig;
|
|
10
12
|
}
|
|
11
13
|
export declare const defineConfig: (allureConfig: Config) => Config;
|
package/dist/utils/tree.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type Comparator, type DefaultTreeGroup, type DefaultTreeLeaf, type Test
|
|
|
2
2
|
export declare const byLabels: (item: TestResult, labelNames: string[]) => string[][];
|
|
3
3
|
export declare const filterTreeLabels: (data: TestResult[], labelNames: string[]) => string[];
|
|
4
4
|
export declare const createTreeByLabels: <T = TestResult, L = DefaultTreeLeaf, G = DefaultTreeGroup>(data: T[], labelNames: string[], leafFactory?: (item: T) => TreeLeaf<L>, groupFactory?: (parentGroup: string | undefined, groupClassifier: string) => TreeGroup<G>, addLeafToGroup?: (group: TreeGroup<G>, leaf: TreeLeaf<L>) => void) => TreeData<L, G>;
|
|
5
|
+
export declare const preciseTreeLabels: <T = TestResult>(labelNames: string[], trs: T[], labelNamesAccessor?: (tr: T) => string[]) => string[];
|
|
5
6
|
export declare const filterTree: <L, G>(tree: TreeData<L, G>, predicate: (leaf: TreeLeaf<L>) => boolean) => TreeData<L, G>;
|
|
6
7
|
export declare const sortTree: <L, G>(tree: TreeData<L, G>, comparator: Comparator<TreeLeaf<L>>) => TreeData<L, G>;
|
|
7
8
|
export declare const transformTree: <L, G>(tree: TreeData<L, G>, transformer: (leaf: TreeLeaf<L>, idx: number) => TreeLeaf<L>) => TreeData<L, G>;
|
package/dist/utils/tree.js
CHANGED
|
@@ -87,6 +87,15 @@ export const createTreeByLabels = (data, labelNames, leafFactory, groupFactory,
|
|
|
87
87
|
}));
|
|
88
88
|
return createTree(data, (item) => byLabels(item, labelNames), leafFactoryFn, groupFactoryFn, addLeafToGroup);
|
|
89
89
|
};
|
|
90
|
+
export const preciseTreeLabels = (labelNames, trs, labelNamesAccessor = (tr) => tr.labels.map(({ name }) => name)) => {
|
|
91
|
+
const result = new Set();
|
|
92
|
+
for (const labelName of labelNames) {
|
|
93
|
+
if (trs.some((tr) => labelNamesAccessor(tr).includes(labelName))) {
|
|
94
|
+
result.add(labelName);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return Array.from(result);
|
|
98
|
+
};
|
|
90
99
|
export const filterTree = (tree, predicate) => {
|
|
91
100
|
const visitedGroups = new Set();
|
|
92
101
|
const { root, leavesById, groupsById } = tree;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-api",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.8",
|
|
4
4
|
"description": "Allure Plugin API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "rimraf ./out && vitest run"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
29
|
+
"@allurereport/core-api": "3.0.0-beta.8"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@stylistic/eslint-plugin": "^2.6.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@typescript-eslint/parser": "^8.0.0",
|
|
37
37
|
"@vitest/runner": "^2.1.8",
|
|
38
38
|
"@vitest/snapshot": "^2.1.8",
|
|
39
|
-
"allure-vitest": "^3.0.
|
|
39
|
+
"allure-vitest": "^3.0.9",
|
|
40
40
|
"eslint": "^8.57.0",
|
|
41
41
|
"eslint-config-prettier": "^9.1.0",
|
|
42
42
|
"eslint-plugin-import": "^2.29.1",
|