🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@allurereport/plugin-api

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@allurereport/plugin-api - npm Package Compare versions

Comparing version
3.0.0-beta.8
to
3.0.0-beta.9
+2
-0
dist/utils/tree.d.ts

@@ -5,2 +5,4 @@ import { type Comparator, type DefaultTreeGroup, type DefaultTreeLeaf, type TestResult, type TreeData, type TreeGroup, type TreeLeaf } from "@allurereport/core-api";

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>;
export declare const createTreeByCategories: <T = TestResult, L = DefaultTreeLeaf, G = DefaultTreeGroup>(data: T[], leafFactory?: (item: T) => TreeLeaf<L>, groupFactory?: (parentGroup: string | undefined, groupClassifier: string) => TreeGroup<G>, addLeafToGroup?: (group: TreeGroup<G>, leaf: TreeLeaf<L>) => void) => TreeData<L, G>;
export declare const byCategories: (item: TestResult) => string[][];
export declare const preciseTreeLabels: <T = TestResult>(labelNames: string[], trs: T[], labelNamesAccessor?: (tr: T) => string[]) => string[];

@@ -7,0 +9,0 @@ export declare const filterTree: <L, G>(tree: TreeData<L, G>, predicate: (leaf: TreeLeaf<L>) => boolean) => TreeData<L, G>;

@@ -90,2 +90,24 @@ import { findByLabelName, } from "@allurereport/core-api";

};
export const createTreeByCategories = (data, leafFactory, groupFactory, addLeafToGroup = () => { }) => {
const leafFactoryFn = leafFactory ??
((tr) => {
const { id, name, status, duration } = tr;
return {
nodeId: id,
name,
status,
duration,
};
});
const groupFactoryFn = groupFactory ??
((parentId, groupClassifier) => ({
nodeId: md5((parentId ? `${parentId}.` : "") + groupClassifier),
name: groupClassifier,
statistic: emptyStatistic(),
}));
return createTree(data, (item) => byCategories(item), leafFactoryFn, groupFactoryFn, addLeafToGroup);
};
export const byCategories = (item) => {
return [item.categories?.map((category) => category.name)];
};
export const preciseTreeLabels = (labelNames, trs, labelNamesAccessor = (tr) => tr.labels.map(({ name }) => name)) => {

@@ -92,0 +114,0 @@ const result = new Set();

+2
-2
{
"name": "@allurereport/plugin-api",
"version": "3.0.0-beta.8",
"version": "3.0.0-beta.9",
"description": "Allure Plugin API",

@@ -29,3 +29,3 @@ "keywords": [

"dependencies": {
"@allurereport/core-api": "3.0.0-beta.8"
"@allurereport/core-api": "3.0.0-beta.9"
},

@@ -32,0 +32,0 @@ "devDependencies": {