@allurereport/plugin-log 3.0.0-beta.3 → 3.0.0-beta.5
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/plugin.js +5 -4
- package/dist/utils.js +3 -5
- package/package.json +5 -3
package/dist/plugin.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as console from "node:console";
|
|
1
2
|
import { gray } from "yoctocolors";
|
|
2
3
|
import { printSummary, printTest } from "./utils.js";
|
|
3
4
|
export class LogPlugin {
|
|
@@ -5,13 +6,13 @@ export class LogPlugin {
|
|
|
5
6
|
this.options = options;
|
|
6
7
|
this.done = async (context, store) => {
|
|
7
8
|
const { groupBy = "suite" } = this.options ?? {};
|
|
8
|
-
const
|
|
9
|
+
const allTestResults = await store.allTestResults();
|
|
9
10
|
if (groupBy === "none") {
|
|
10
|
-
|
|
11
|
+
allTestResults.forEach((test) => {
|
|
11
12
|
printTest(test, this.options);
|
|
12
13
|
});
|
|
13
14
|
console.log("");
|
|
14
|
-
printSummary(Array.from(
|
|
15
|
+
printSummary(Array.from(allTestResults));
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
const groupedTests = await store.testResultsByLabel(groupBy);
|
|
@@ -31,7 +32,7 @@ export class LogPlugin {
|
|
|
31
32
|
});
|
|
32
33
|
console.log("");
|
|
33
34
|
});
|
|
34
|
-
printSummary(Array.from(
|
|
35
|
+
printSummary(Array.from(allTestResults));
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
}
|
package/dist/utils.js
CHANGED
|
@@ -48,9 +48,7 @@ export const stringifyStepResultTitle = (result) => {
|
|
|
48
48
|
};
|
|
49
49
|
export const printTest = (test, options, indent = 0) => {
|
|
50
50
|
const title = stringifyTestResultTitle(test);
|
|
51
|
-
const stepsToPrint =
|
|
52
|
-
? test.steps.filter(isStep)
|
|
53
|
-
: test.steps.filter(isFailedResult).filter(isStep);
|
|
51
|
+
const stepsToPrint = options?.allSteps ? test.steps.filter(isStep) : test.steps.filter(isFailedResult).filter(isStep);
|
|
54
52
|
const failedResult = isFailedResult(test);
|
|
55
53
|
const indentSpaces = " ".repeat(indent);
|
|
56
54
|
console.info(`${indentSpaces}${title}`);
|
|
@@ -86,8 +84,8 @@ export const printStep = (step, options, indent = 0) => {
|
|
|
86
84
|
if (!stepsToPrint?.length) {
|
|
87
85
|
return;
|
|
88
86
|
}
|
|
89
|
-
stepsToPrint.forEach((
|
|
90
|
-
printStep(
|
|
87
|
+
stepsToPrint.forEach((child) => {
|
|
88
|
+
printStep(child, options, indent + 1);
|
|
91
89
|
});
|
|
92
90
|
};
|
|
93
91
|
export const printSummary = (results) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-log",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
4
4
|
"description": "Allure Plugin to write report in stdout",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -26,11 +26,13 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "run clean && tsc --project ./tsconfig.json",
|
|
28
28
|
"clean": "rimraf ./dist",
|
|
29
|
+
"eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
|
|
30
|
+
"eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
|
|
29
31
|
"test": "rimraf ./out && vitest run"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
33
|
-
"@allurereport/plugin-api": "3.0.0-beta.
|
|
34
|
+
"@allurereport/core-api": "3.0.0-beta.5",
|
|
35
|
+
"@allurereport/plugin-api": "3.0.0-beta.5",
|
|
34
36
|
"yoctocolors": "^2.1.1"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|