@allurereport/plugin-awesome 3.0.0-beta.3 → 3.0.0-beta.4

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/charts.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Statistic, TestStatus } from "@allurereport/core-api";
2
- import { PieArcDatum } from "d3-shape";
2
+ import type { PieArcDatum } from "d3-shape";
3
3
  export type TestResultSlice = {
4
4
  status: TestStatus;
5
5
  count: number;
@@ -10,5 +10,5 @@ export type TestResultChartData = {
10
10
  };
11
11
  export declare const d3Arc: import("d3-shape").Arc<any, PieArcDatum<TestResultSlice>>;
12
12
  export declare const d3Pie: import("d3-shape").Pie<any, TestResultSlice>;
13
- export declare function getPercentage(value: number, total: number): number;
13
+ export declare const getPercentage: (value: number, total: number) => number;
14
14
  export declare const getChartData: (stats: Statistic) => TestResultChartData;
package/dist/charts.js CHANGED
@@ -5,9 +5,7 @@ export const d3Pie = pie()
5
5
  .value((d) => d.count)
6
6
  .padAngle(0.03)
7
7
  .sortValues((a, b) => a - b);
8
- export function getPercentage(value, total) {
9
- return Math.floor((value / total) * 10000) / 100;
10
- }
8
+ export const getPercentage = (value, total) => Math.floor((value / total) * 10000) / 100;
11
9
  export const getChartData = (stats) => {
12
10
  const convertedStatuses = statusesList
13
11
  .filter((status) => !!stats?.[status])
@@ -16,9 +14,9 @@ export const getChartData = (stats) => {
16
14
  count: stats[status],
17
15
  }));
18
16
  const arcsData = d3Pie(convertedStatuses);
19
- const slices = arcsData.map((arc) => ({
20
- d: d3Arc(arc),
21
- ...arc.data,
17
+ const slices = arcsData.map((arcData) => ({
18
+ d: d3Arc(arcData),
19
+ ...arcData.data,
22
20
  }));
23
21
  const percentage = getPercentage(stats.passed ?? 0, stats.total);
24
22
  return {
@@ -127,8 +127,7 @@ export const generateAttachmentsFiles = async (writer, attachmentLinks, contentF
127
127
  export const generateHistoryDataPoints = async (writer, store) => {
128
128
  const result = new Map();
129
129
  const allHistoryPoints = await store.allHistoryDataPoints();
130
- allHistoryPoints.sort((a, b) => b.timestamp - a.timestamp);
131
- for (const historyPoint of allHistoryPoints?.slice(0, 6)) {
130
+ for (const historyPoint of allHistoryPoints.slice(0, 6)) {
132
131
  const src = `history/${historyPoint.uuid}.json`;
133
132
  await writer.writeData(src, historyPoint);
134
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-awesome",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Allure Awesome Plugin – brand new HTML report with modern design and new features",
5
5
  "keywords": [
6
6
  "allure",
@@ -25,13 +25,15 @@
25
25
  "scripts": {
26
26
  "build": "run clean && tsc --project ./tsconfig.json",
27
27
  "clean": "rimraf ./dist",
28
+ "eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
29
+ "eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
28
30
  "test": "rimraf ./out && vitest run"
29
31
  },
30
32
  "dependencies": {
31
- "@allurereport/core-api": "3.0.0-beta.3",
32
- "@allurereport/plugin-api": "3.0.0-beta.3",
33
- "@allurereport/web-awesome": "3.0.0-beta.3",
34
- "@allurereport/web-commons": "3.0.0-beta.3",
33
+ "@allurereport/core-api": "3.0.0-beta.4",
34
+ "@allurereport/plugin-api": "3.0.0-beta.4",
35
+ "@allurereport/web-awesome": "3.0.0-beta.4",
36
+ "@allurereport/web-commons": "3.0.0-beta.4",
35
37
  "d3-shape": "^3.2.0",
36
38
  "handlebars": "^4.7.8"
37
39
  },