@allurereport/plugin-progress 3.14.2 → 3.15.0
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.d.ts +2 -0
- package/dist/plugin.js +11 -6
- package/package.json +4 -4
package/dist/plugin.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ export declare class ProgressPlugin implements Plugin {
|
|
|
4
4
|
#private;
|
|
5
5
|
readonly options: {
|
|
6
6
|
stream?: WriteStream;
|
|
7
|
+
preserve?: boolean;
|
|
7
8
|
};
|
|
8
9
|
constructor(options?: {
|
|
9
10
|
stream?: WriteStream;
|
|
11
|
+
preserve?: boolean;
|
|
10
12
|
});
|
|
11
13
|
start: (context: PluginContext, store: AllureStore, realtime: RealtimeSubscriber) => Promise<void>;
|
|
12
14
|
}
|
package/dist/plugin.js
CHANGED
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _ProgressPlugin_terminal, _ProgressPlugin_render;
|
|
12
|
+
var _ProgressPlugin_terminal, _ProgressPlugin_preserve, _ProgressPlugin_render;
|
|
13
13
|
import * as process from "node:process";
|
|
14
14
|
import { green, red, yellow } from "yoctocolors";
|
|
15
15
|
import { Terminal } from "./terminal.js";
|
|
@@ -17,6 +17,7 @@ export class ProgressPlugin {
|
|
|
17
17
|
constructor(options = {}) {
|
|
18
18
|
this.options = options;
|
|
19
19
|
_ProgressPlugin_terminal.set(this, void 0);
|
|
20
|
+
_ProgressPlugin_preserve.set(this, false);
|
|
20
21
|
this.start = async (context, store, realtime) => {
|
|
21
22
|
realtime.onTestResults(async () => {
|
|
22
23
|
await __classPrivateFieldGet(this, _ProgressPlugin_render, "f").call(this, store);
|
|
@@ -26,9 +27,11 @@ export class ProgressPlugin {
|
|
|
26
27
|
if (!__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f")) {
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
__classPrivateFieldGet(this,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (!__classPrivateFieldGet(this, _ProgressPlugin_preserve, "f")) {
|
|
31
|
+
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").cursorRelativeReset();
|
|
32
|
+
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").clearLine();
|
|
33
|
+
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").clearBottom();
|
|
34
|
+
}
|
|
32
35
|
const testsStatistic = await store.testsStatistic();
|
|
33
36
|
if (testsStatistic.failed) {
|
|
34
37
|
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").write(`${red("failed")}: ${testsStatistic.failed}`);
|
|
@@ -43,11 +46,13 @@ export class ProgressPlugin {
|
|
|
43
46
|
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").newline();
|
|
44
47
|
}
|
|
45
48
|
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").write(`total: ${testsStatistic.total}`);
|
|
49
|
+
__classPrivateFieldGet(this, _ProgressPlugin_terminal, "f").newline();
|
|
46
50
|
});
|
|
47
|
-
const { stream = process.stdout } = this.options;
|
|
51
|
+
const { stream = process.stdout, preserve = false } = this.options;
|
|
48
52
|
if (stream) {
|
|
49
53
|
__classPrivateFieldSet(this, _ProgressPlugin_terminal, new Terminal(stream), "f");
|
|
50
54
|
}
|
|
55
|
+
__classPrivateFieldSet(this, _ProgressPlugin_preserve, preserve, "f");
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
|
-
_ProgressPlugin_terminal = new WeakMap(), _ProgressPlugin_render = new WeakMap();
|
|
58
|
+
_ProgressPlugin_terminal = new WeakMap(), _ProgressPlugin_preserve = new WeakMap(), _ProgressPlugin_render = new WeakMap();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-progress",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Allure Plugin to show generation progress in console",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"lint:fix": "oxlint --import-plugin --fix src test features stories"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@allurereport/core-api": "3.
|
|
35
|
-
"@allurereport/plugin-api": "3.
|
|
36
|
-
"yoctocolors": "^2.1.
|
|
34
|
+
"@allurereport/core-api": "3.15.0",
|
|
35
|
+
"@allurereport/plugin-api": "3.15.0",
|
|
36
|
+
"yoctocolors": "^2.1.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^20",
|