@supertape/formatter-progress-bar 2.1.0 → 2.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.
- package/README.md +7 -9
- package/lib/progress-bar.js +12 -5
- package/package.json +6 -9
package/README.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
# @supertape/formatter-progress-bar [![NPM version][NPMIMGURL]][NPMURL]
|
|
1
|
+
# @supertape/formatter-progress-bar [![NPM version][NPMIMGURL]][NPMURL]
|
|
2
2
|
|
|
3
|
-
[NPMIMGURL]:
|
|
4
|
-
[NPMURL]:
|
|
5
|
-
|
|
6
|
-
[DependencyStatusURL]: https://david-dm.org/coderaiser/supertape?path=packages/formatter-progress-bar
|
|
7
|
-
[DependencyStatusIMGURL]: https://david-dm.org/coderaiser/supertape.svg?path=packages/formatter-progress-bar
|
|
3
|
+
[NPMIMGURL]: https://img.shields.io/npm/v/@supertape/formatter-progress-bar.svg?style=flat&longCache=true
|
|
4
|
+
[NPMURL]: https://npmjs.org/package/@supertape/formatter-progress-bar "npm"
|
|
8
5
|
|
|
9
6
|
`supertape` formatter shows progress bar.
|
|
10
7
|
|
|
@@ -23,10 +20,11 @@ supertape --format progress-bar lib
|
|
|
23
20
|
## Env Variables
|
|
24
21
|
|
|
25
22
|
- `CI=1` - disable progress bar
|
|
26
|
-
- `SUPERTAPE_PROGRESS_BAR=1` - force enable/disable progress bar
|
|
27
|
-
- `
|
|
23
|
+
- `SUPERTAPE_PROGRESS_BAR=1` - force enable/disable progress bar;
|
|
24
|
+
- `SUPERTAPE_PROGRESS_BAR_COLOR` - set color of progress bar;
|
|
25
|
+
- `SUPERTAPE_PROGRESS_BAR_MIN=100` - count of tests to show progress bar;
|
|
26
|
+
- `SUPERTAPE_PROGRESS_BAR_STACK=1` - force show/hide stack on fail;
|
|
28
27
|
|
|
29
28
|
## License
|
|
30
29
|
|
|
31
30
|
MIT
|
|
32
|
-
|
package/lib/progress-bar.js
CHANGED
|
@@ -9,6 +9,8 @@ const fullstore = require('fullstore');
|
|
|
9
9
|
const {isCI} = require('ci-info');
|
|
10
10
|
|
|
11
11
|
const OK = '👌';
|
|
12
|
+
const YELLOW = '#f9d472';
|
|
13
|
+
|
|
12
14
|
const {red} = chalk;
|
|
13
15
|
const formatErrorsCount = (a) => a ? red(a) : OK;
|
|
14
16
|
|
|
@@ -21,6 +23,7 @@ const {
|
|
|
21
23
|
SUPERTAPE_PROGRESS_BAR,
|
|
22
24
|
SUPERTAPE_PROGRESS_BAR_MIN = 100,
|
|
23
25
|
SUPERTAPE_PROGRESS_BAR_COLOR,
|
|
26
|
+
SUPERTAPE_PROGRESS_BAR_STACK = 1,
|
|
24
27
|
} = process.env;
|
|
25
28
|
|
|
26
29
|
let bar;
|
|
@@ -28,7 +31,7 @@ let bar;
|
|
|
28
31
|
module.exports.start = ({total}) => {
|
|
29
32
|
out('TAP version 13');
|
|
30
33
|
|
|
31
|
-
const color = SUPERTAPE_PROGRESS_BAR_COLOR ||
|
|
34
|
+
const color = SUPERTAPE_PROGRESS_BAR_COLOR || YELLOW;
|
|
32
35
|
|
|
33
36
|
bar = createProgress({
|
|
34
37
|
total,
|
|
@@ -68,8 +71,12 @@ module.exports.fail = ({at, count, message, operator, actual, expected, output,
|
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
out(` ${at}`);
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
|
|
75
|
+
if (SUPERTAPE_PROGRESS_BAR_STACK !== '0') {
|
|
76
|
+
out(' stack: |-');
|
|
77
|
+
out(errorStack);
|
|
78
|
+
}
|
|
79
|
+
|
|
73
80
|
out(' ...');
|
|
74
81
|
out('');
|
|
75
82
|
};
|
|
@@ -96,10 +103,9 @@ module.exports.end = ({count, passed, failed, skiped}) => {
|
|
|
96
103
|
if (!failed) {
|
|
97
104
|
out('# ✅ ok');
|
|
98
105
|
out('');
|
|
106
|
+
out('');
|
|
99
107
|
}
|
|
100
108
|
|
|
101
|
-
out('');
|
|
102
|
-
|
|
103
109
|
return `\r${out()}`;
|
|
104
110
|
};
|
|
105
111
|
|
|
@@ -146,6 +152,7 @@ const createProgress = once(({total, color, test}) => {
|
|
|
146
152
|
barIncompleteChar: '\u2591',
|
|
147
153
|
clearOnComplete: true,
|
|
148
154
|
stopOnComplete: true,
|
|
155
|
+
hideCursor: true,
|
|
149
156
|
stream: getStream({
|
|
150
157
|
total,
|
|
151
158
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supertape/formatter-progress-bar",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "supertape formatter progress bar",
|
|
6
6
|
"homepage": "http://github.com/coderaiser/supertape",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"chalk": "^4.1.0",
|
|
27
|
-
"ci-info": "^
|
|
27
|
+
"ci-info": "^3.1.1",
|
|
28
28
|
"cli-progress": "^3.8.2",
|
|
29
29
|
"fullstore": "^3.0.0",
|
|
30
30
|
"once": "^1.4.0"
|
|
@@ -36,20 +36,17 @@
|
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/core": "^7.12.9",
|
|
39
|
-
"@babel/eslint-parser": "^7.12.1",
|
|
40
39
|
"c8": "^7.3.5",
|
|
41
|
-
"
|
|
42
|
-
"eslint": "^7.0.0",
|
|
40
|
+
"eslint": "^8.0.0-beta.0",
|
|
43
41
|
"eslint-plugin-node": "^11.1.0",
|
|
44
|
-
"eslint-plugin-putout": "^
|
|
42
|
+
"eslint-plugin-putout": "^12.0.0",
|
|
45
43
|
"madrun": "^8.0.0",
|
|
46
44
|
"mock-require": "^3.0.2",
|
|
47
45
|
"montag": "^1.0.0",
|
|
48
46
|
"nodemon": "^2.0.2",
|
|
49
|
-
"nyc": "^15.0.1",
|
|
50
47
|
"pullout": "^4.0.0",
|
|
51
|
-
"putout": "^
|
|
52
|
-
"supertape": "^
|
|
48
|
+
"putout": "^22.0.0",
|
|
49
|
+
"supertape": "^6.0.1"
|
|
53
50
|
},
|
|
54
51
|
"license": "MIT",
|
|
55
52
|
"engines": {
|