🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

@allurereport/plugin-api

Package Overview
Dependencies
Maintainers
2
Versions
43
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.23
to
3.0.0-beta.24
+1
-0
dist/store.d.ts

@@ -15,2 +15,3 @@ import type { AttachmentLink, HistoryDataPoint, HistoryTestResult, KnownTestFailure, ReportVariables, Statistic, TestCase, TestEnvGroup, TestError, TestFixtureResult, TestResult } from "@allurereport/core-api";

allHistoryDataPoints: () => Promise<HistoryDataPoint[]>;
allHistoryDataPointsByEnvironment: (environment: string) => Promise<HistoryDataPoint[]>;
allKnownIssues: () => Promise<KnownTestFailure[]>;

@@ -17,0 +18,0 @@ allNewTestResults: () => Promise<TestResult[]>;

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

export declare const createTreeByTitlePath: <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 createTreeByLabelsAndTitlePath: <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>;

@@ -219,1 +219,37 @@ import { findByLabelName, } from "@allurereport/core-api";

};
const byLabelsAndTitlePath = (item, labelNames) => {
const leaves = [];
for (const labelName of labelNames) {
const values = item.labels.filter((label) => label.name === labelName).map((label) => label.value ?? "");
if (!values.length) {
continue;
}
leaves.push(values);
}
const titlePath = item.titlePath;
if (Array.isArray(titlePath) && titlePath.length > 0) {
for (const segment of titlePath) {
leaves.push([segment]);
}
}
return leaves;
};
export const createTreeByLabelsAndTitlePath = (data, labelNames = [], 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) => byLabelsAndTitlePath(item, labelNames), leafFactoryFn, groupFactoryFn, addLeafToGroup);
};
+2
-2
{
"name": "@allurereport/plugin-api",
"version": "3.0.0-beta.23",
"version": "3.0.0-beta.24",
"description": "Allure Plugin API",

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

"dependencies": {
"@allurereport/core-api": "3.0.0-beta.23"
"@allurereport/core-api": "3.0.0-beta.24"
},

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