supertape 7.2.1 → 7.3.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/ChangeLog +27 -0
- package/README.md +29 -0
- package/lib/cli.js +10 -6
- package/lib/exit-codes.js +2 -0
- package/lib/is-debug.js +1 -2
- package/lib/supertape.js +2 -2
- package/package.json +7 -6
package/ChangeLog
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
2022.05.30, v7.3.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- (package) eslint-plugin-putout v15.4.0
|
|
5
|
+
- (package) lerna v5.0.0
|
|
6
|
+
- (supertape) exit codes: add SKIPED
|
|
7
|
+
- (package) putout v26.0.0
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
2022.04.06, v7.2.3
|
|
11
|
+
|
|
12
|
+
fix:
|
|
13
|
+
- (@supertape/engine-loader) rm unused @cloudcmd/stub
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
feature:
|
|
17
|
+
- (package) @supertape/operator-stub v2.0.0
|
|
18
|
+
- (package) @cloudcmd/stub v4.0.0
|
|
19
|
+
- (@supertape/operator-stub) drop support of node < 16
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
2022.04.06, v7.2.2
|
|
23
|
+
|
|
24
|
+
feature:
|
|
25
|
+
- (package) @cloudcmd/stub v4.0.0
|
|
26
|
+
|
|
27
|
+
|
|
1
28
|
2022.03.29, v7.2.1
|
|
2
29
|
|
|
3
30
|
fix:
|
package/README.md
CHANGED
|
@@ -59,6 +59,7 @@ Options
|
|
|
59
59
|
- `SUPERTAPE_CHECK_DUPLICATES` - toggle check duplicates;
|
|
60
60
|
- `SUPERTAPE_CHECK_SCOPES` - check that test message has a scope: `scope: subject`;
|
|
61
61
|
- `SUPERTAPE_CHECK_ASSERTIONS_COUNT` - check that assertion count is no more then 1;
|
|
62
|
+
- `SUPERTAPE_CHECK_SKIPED` - check that skiped count equal to `0`, exit with status code
|
|
62
63
|
|
|
63
64
|
```js
|
|
64
65
|
test('tape: error', (t) => {
|
|
@@ -255,6 +256,34 @@ test('lib: diff', (t) => {
|
|
|
255
256
|
`;
|
|
256
257
|
```
|
|
257
258
|
|
|
259
|
+
## 🚪Exit Codes
|
|
260
|
+
|
|
261
|
+
📼**Supertape** can have one of next [exit codes](https://github.com/coderaiser/supertape/blob/master/packages/supertape/lib/exit-codes.js):
|
|
262
|
+
|
|
263
|
+
| Code | Name | Description |
|
|
264
|
+
|------|------|-----------------|
|
|
265
|
+
| 0 | `OK` | no errors found |
|
|
266
|
+
| 1 | `FAIL` | test failed |
|
|
267
|
+
| 2 | `WAS_STOP` | test was halted by user |
|
|
268
|
+
| 3 | `UNHANDLED`| unhandled exception occured |
|
|
269
|
+
| 4 | `INVALID_OPTION`| wrong option provided |
|
|
270
|
+
| 5 | `SKIPED` | works only with `SUPERTAPE_CHECK_SKIPED` env variable when skiped files 1 and more |
|
|
271
|
+
|
|
272
|
+
Here is how exit code can look like:
|
|
273
|
+
|
|
274
|
+
```js
|
|
275
|
+
import {SKIPED} from 'supertape/exit-codes';
|
|
276
|
+
|
|
277
|
+
const env = {
|
|
278
|
+
ESCOVER_SUCCESS_EXIT_CODE: SKIPED,
|
|
279
|
+
SUPERTAPE_CHECK_SKIPED: 1,
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export default {
|
|
283
|
+
test: () => [env, `escover tape 'test/**/*.js' 'lib/**/*.spec.js'`],
|
|
284
|
+
};
|
|
285
|
+
```
|
|
286
|
+
|
|
258
287
|
## License
|
|
259
288
|
|
|
260
289
|
MIT
|
package/lib/cli.js
CHANGED
|
@@ -18,6 +18,7 @@ const {
|
|
|
18
18
|
WAS_STOP,
|
|
19
19
|
UNHANDLED,
|
|
20
20
|
INVALID_OPTION,
|
|
21
|
+
SKIPED,
|
|
21
22
|
} = require('./exit-codes');
|
|
22
23
|
|
|
23
24
|
const {isArray} = Array;
|
|
@@ -33,6 +34,7 @@ const {
|
|
|
33
34
|
SUPERTAPE_CHECK_DUPLICATES = '1',
|
|
34
35
|
SUPERTAPE_CHECK_SCOPES = '1',
|
|
35
36
|
SUPERTAPE_CHECK_ASSERTIONS_COUNT = '1',
|
|
37
|
+
SUPERTAPE_CHECK_SKIPED = '0',
|
|
36
38
|
} = process.env;
|
|
37
39
|
|
|
38
40
|
module.exports = async ({argv, cwd, stdout, stderr, exit}) => {
|
|
@@ -54,11 +56,14 @@ module.exports = async ({argv, cwd, stdout, stderr, exit}) => {
|
|
|
54
56
|
failed,
|
|
55
57
|
code,
|
|
56
58
|
message,
|
|
59
|
+
skiped,
|
|
57
60
|
} = result;
|
|
58
61
|
|
|
59
|
-
if (
|
|
62
|
+
if (Number(SUPERTAPE_CHECK_SKIPED) && skiped)
|
|
63
|
+
return exit(SKIPED);
|
|
64
|
+
|
|
65
|
+
if (failed)
|
|
60
66
|
return exit(FAIL);
|
|
61
|
-
}
|
|
62
67
|
|
|
63
68
|
if (code === INVALID_OPTION) {
|
|
64
69
|
stderr.write(`${message}\n`);
|
|
@@ -140,6 +145,7 @@ async function cli({argv, cwd, stdout, isStop}) {
|
|
|
140
145
|
await import(module);
|
|
141
146
|
|
|
142
147
|
const allFiles = [];
|
|
148
|
+
|
|
143
149
|
for (const arg of args._) {
|
|
144
150
|
const files = glob.sync(arg).filter(isExclude);
|
|
145
151
|
allFiles.push(...files);
|
|
@@ -179,11 +185,9 @@ async function cli({argv, cwd, stdout, isStop}) {
|
|
|
179
185
|
return OK;
|
|
180
186
|
|
|
181
187
|
await Promise.all(promises);
|
|
182
|
-
const [
|
|
188
|
+
const [result] = await once(supertape.run(), 'end');
|
|
183
189
|
|
|
184
|
-
return
|
|
185
|
-
failed,
|
|
186
|
-
};
|
|
190
|
+
return result;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
module.exports._filesCount = filesCount;
|
package/lib/exit-codes.js
CHANGED
package/lib/is-debug.js
CHANGED
package/lib/supertape.js
CHANGED
|
@@ -68,13 +68,13 @@ function _createEmitter({quiet, format, getOperators, isStop}) {
|
|
|
68
68
|
harness.pipe(stdout);
|
|
69
69
|
|
|
70
70
|
const operators = await getOperators();
|
|
71
|
-
const
|
|
71
|
+
const result = await runTests(tests, {
|
|
72
72
|
formatter,
|
|
73
73
|
operators,
|
|
74
74
|
isStop,
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
emitter.emit('end',
|
|
77
|
+
emitter.emit('end', result);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
return emitter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supertape",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "📼 Supertape simplest high speed test runner with superpowers",
|
|
6
6
|
"homepage": "http://github.com/coderaiser/supertape",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"default": "./lib/supertape.js"
|
|
15
15
|
},
|
|
16
16
|
"./bin/supertape": "./bin/supertape.mjs",
|
|
17
|
-
"./cli": "./lib/cli.js"
|
|
17
|
+
"./cli": "./lib/cli.js",
|
|
18
|
+
"./exit-codes": "./lib/exit-codes.js"
|
|
18
19
|
},
|
|
19
20
|
"type": "commonjs",
|
|
20
21
|
"bin": {
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"wisdom": "madrun wisdom"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@cloudcmd/stub": "^
|
|
42
|
+
"@cloudcmd/stub": "^4.0.0",
|
|
42
43
|
"@putout/cli-keypress": "^1.0.0",
|
|
43
44
|
"@putout/cli-validate-args": "^1.0.1",
|
|
44
45
|
"@supertape/engine-loader": "^1.0.0",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"@supertape/formatter-progress-bar": "^2.0.0",
|
|
48
49
|
"@supertape/formatter-short": "^1.0.0",
|
|
49
50
|
"@supertape/formatter-tap": "^2.0.0",
|
|
50
|
-
"@supertape/operator-stub": "^
|
|
51
|
+
"@supertape/operator-stub": "^2.0.0",
|
|
51
52
|
"cli-progress": "^3.8.2",
|
|
52
53
|
"deep-equal": "^2.0.3",
|
|
53
54
|
"fullstore": "^3.0.0",
|
|
@@ -78,14 +79,14 @@
|
|
|
78
79
|
"check-dts": "^0.6.5",
|
|
79
80
|
"eslint": "^8.0.0",
|
|
80
81
|
"eslint-plugin-node": "^11.1.0",
|
|
81
|
-
"eslint-plugin-putout": "^
|
|
82
|
+
"eslint-plugin-putout": "^15.4.0",
|
|
82
83
|
"find-up": "^6.3.0",
|
|
83
84
|
"madrun": "^9.0.0",
|
|
84
85
|
"mock-require": "^3.0.2",
|
|
85
86
|
"montag": "^1.0.0",
|
|
86
87
|
"nodemon": "^2.0.2",
|
|
87
88
|
"pullout": "^4.0.0",
|
|
88
|
-
"putout": "^
|
|
89
|
+
"putout": "^26.0.0",
|
|
89
90
|
"runsome": "^1.0.0",
|
|
90
91
|
"try-catch": "^3.0.0",
|
|
91
92
|
"typescript": "^4.4.4"
|