@allurereport/plugin-classic 3.1.0 → 3.3.1

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.
@@ -1,3 +1,6 @@
1
+ import MarkdownIt from "markdown-it";
2
+ const md = new MarkdownIt();
3
+ const markdownToHtml = (value) => (value ? md.render(value) : undefined);
1
4
  const mapLabelsByName = (labels) => {
2
5
  return labels.reduce((acc, { name, value }) => {
3
6
  acc[name] = acc[name] || [];
@@ -28,6 +31,7 @@ export const convertTestResult = (tr) => {
28
31
  steps: tr.steps,
29
32
  error: tr.error,
30
33
  testCase: tr.testCase,
34
+ descriptionHtml: tr.descriptionHtml ?? markdownToHtml(tr.description),
31
35
  setup: [],
32
36
  teardown: [],
33
37
  history: [],
package/dist/model.d.ts CHANGED
@@ -4,7 +4,7 @@ export type ClassicOptions = {
4
4
  singleFile?: boolean;
5
5
  logo?: string;
6
6
  theme?: "light" | "dark" | "auto";
7
- reportLanguage?: "en";
7
+ reportLanguage?: string;
8
8
  groupBy?: string[];
9
9
  ci?: {
10
10
  type: "github" | "jenkins";
package/dist/plugin.js CHANGED
@@ -10,8 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
12
  var _ClassicPlugin_writer, _ClassicPlugin_generate;
13
- import { getWorstStatus } from "@allurereport/core-api";
14
- import { convertToSummaryTestResult, } from "@allurereport/plugin-api";
13
+ import { createPluginSummary, } from "@allurereport/plugin-api";
15
14
  import { preciseTreeLabels } from "@allurereport/plugin-api";
16
15
  import { generateAttachmentsFiles, generateEnvironmentJson, generateHistoryDataPoints, generatePieChart, generateStaticFiles, generateStatistic, generateTestResults, generateTree, generateTreeByCategories, } from "./generators.js";
17
16
  import { InMemoryReportDataWriter, ReportFileDataWriter } from "./writer.js";
@@ -74,29 +73,19 @@ export class ClassicPlugin {
74
73
  };
75
74
  }
76
75
  async info(context, store) {
77
- const allTrs = (await store.allTestResults()).filter(this.options.filter ? this.options.filter : () => true);
78
- const newTrs = await store.allNewTestResults();
79
- const retryTrs = allTrs.filter((tr) => !!tr?.retries?.length);
80
- const flakyTrs = allTrs.filter((tr) => !!tr?.flaky);
81
- const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
82
- const worstStatus = getWorstStatus(allTrs.map(({ status }) => status));
83
- const createdAt = allTrs.reduce((acc, { stop }) => Math.max(acc, stop || 0), 0);
84
- return {
76
+ return createPluginSummary({
85
77
  name: this.options.reportName || context.reportName,
86
- stats: await store.testsStatistic(this.options.filter),
87
- status: worstStatus ?? "passed",
88
- createdAt,
89
- duration,
90
78
  plugin: "Classic",
91
- newTests: newTrs.map(convertToSummaryTestResult),
92
- flakyTests: flakyTrs.map(convertToSummaryTestResult),
93
- retryTests: retryTrs.map(convertToSummaryTestResult),
94
79
  meta: {
95
80
  reportId: context.reportUuid,
96
81
  singleFile: this.options.singleFile ?? false,
97
82
  withTestResultsLinks: true,
98
83
  },
99
- };
84
+ filter: this.options.filter,
85
+ history: context.history,
86
+ ci: context.ci,
87
+ store,
88
+ });
100
89
  }
101
90
  }
102
91
  _ClassicPlugin_writer = new WeakMap(), _ClassicPlugin_generate = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-classic",
3
- "version": "3.1.0",
3
+ "version": "3.3.1",
4
4
  "description": "The classic version of Allure HTML report",
5
5
  "keywords": [
6
6
  "allure",
@@ -30,18 +30,20 @@
30
30
  "test": "rimraf ./out && vitest run"
31
31
  },
32
32
  "dependencies": {
33
- "@allurereport/core-api": "3.1.0",
34
- "@allurereport/plugin-api": "3.1.0",
35
- "@allurereport/web-awesome": "3.1.0",
36
- "@allurereport/web-classic": "3.1.0",
37
- "@allurereport/web-commons": "3.1.0",
33
+ "@allurereport/core-api": "3.3.1",
34
+ "@allurereport/plugin-api": "3.3.1",
35
+ "@allurereport/web-awesome": "3.3.1",
36
+ "@allurereport/web-classic": "3.3.1",
37
+ "@allurereport/web-commons": "3.3.1",
38
38
  "d3-shape": "^3.2.0",
39
- "handlebars": "^4.7.8"
39
+ "handlebars": "^4.7.8",
40
+ "markdown-it": "^14.1.0"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@stylistic/eslint-plugin": "^2.6.1",
43
44
  "@types/d3-shape": "^3.1.6",
44
45
  "@types/eslint": "^8.56.11",
46
+ "@types/markdown-it": "^14.1.2",
45
47
  "@types/node": "^20.17.9",
46
48
  "@typescript-eslint/eslint-plugin": "^8.0.0",
47
49
  "@typescript-eslint/parser": "^8.0.0",