supertape 7.4.0 → 7.5.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/ChangeLog +18 -0
- package/README.md +5 -5
- package/lib/cli.js +5 -4
- package/lib/exit-codes.js +2 -2
- package/lib/operators.mjs +1 -0
- package/lib/supertape.d.ts +13 -1
- package/lib/supertape.js +1 -0
- package/lib/validator.js +1 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
2022.06.21, v7.5.1
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- (supertape) extend: return type
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
2022.06.21, v7.5.0
|
|
8
|
+
|
|
9
|
+
feature:
|
|
10
|
+
- (supertape) extend: add type
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
2022.06.10, v7.4.1
|
|
14
|
+
|
|
15
|
+
fix:
|
|
16
|
+
- (supertape) get back: SKIPPED -> SKIPED
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
2022.06.09, v7.4.0
|
|
2
20
|
|
|
3
21
|
fix:
|
package/README.md
CHANGED
|
@@ -59,7 +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
|
-
- `
|
|
62
|
+
- `SUPERTAPE_CHECK_SKIPED` - check that skiped count equal to `0`, exit with status code
|
|
63
63
|
|
|
64
64
|
```js
|
|
65
65
|
test('tape: error', (t) => {
|
|
@@ -267,16 +267,16 @@ test('lib: diff', (t) => {
|
|
|
267
267
|
| 2 | `WAS_STOP` | test was halted by user |
|
|
268
268
|
| 3 | `UNHANDLED`| unhandled exception occured |
|
|
269
269
|
| 4 | `INVALID_OPTION`| wrong option provided |
|
|
270
|
-
| 5 | `
|
|
270
|
+
| 5 | `SKIPED` | works only with `SUPERTAPE_CHECK_SKIPED` env variable when skiped files 1 and more |
|
|
271
271
|
|
|
272
272
|
Here is how exit code can look like:
|
|
273
273
|
|
|
274
274
|
```js
|
|
275
|
-
import {
|
|
275
|
+
import {SKIPED} from 'supertape/exit-codes';
|
|
276
276
|
|
|
277
277
|
const env = {
|
|
278
|
-
ESCOVER_SUCCESS_EXIT_CODE:
|
|
279
|
-
|
|
278
|
+
ESCOVER_SUCCESS_EXIT_CODE: SKIPED,
|
|
279
|
+
SUPERTAPE_CHECK_SKIPED: 1,
|
|
280
280
|
};
|
|
281
281
|
|
|
282
282
|
export default {
|
package/lib/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ const {
|
|
|
18
18
|
WAS_STOP,
|
|
19
19
|
UNHANDLED,
|
|
20
20
|
INVALID_OPTION,
|
|
21
|
-
|
|
21
|
+
SKIPED,
|
|
22
22
|
} = require('./exit-codes');
|
|
23
23
|
|
|
24
24
|
const {isArray} = Array;
|
|
@@ -34,7 +34,7 @@ const {
|
|
|
34
34
|
SUPERTAPE_CHECK_DUPLICATES = '1',
|
|
35
35
|
SUPERTAPE_CHECK_SCOPES = '1',
|
|
36
36
|
SUPERTAPE_CHECK_ASSERTIONS_COUNT = '1',
|
|
37
|
-
|
|
37
|
+
SUPERTAPE_CHECK_SKIPED = '0',
|
|
38
38
|
} = process.env;
|
|
39
39
|
|
|
40
40
|
module.exports = async ({argv, cwd, stdout, stderr, exit}) => {
|
|
@@ -59,8 +59,8 @@ module.exports = async ({argv, cwd, stdout, stderr, exit}) => {
|
|
|
59
59
|
skiped,
|
|
60
60
|
} = result;
|
|
61
61
|
|
|
62
|
-
if (Number(
|
|
63
|
-
return exit(
|
|
62
|
+
if (Number(SUPERTAPE_CHECK_SKIPED) && skiped)
|
|
63
|
+
return exit(SKIPED);
|
|
64
64
|
|
|
65
65
|
if (failed)
|
|
66
66
|
return exit(FAIL);
|
|
@@ -125,6 +125,7 @@ async function cli({argv, cwd, stdout, isStop}) {
|
|
|
125
125
|
if (args.help) {
|
|
126
126
|
const {help} = await import('./help.js');
|
|
127
127
|
stdout.write(help());
|
|
128
|
+
|
|
128
129
|
return OK;
|
|
129
130
|
}
|
|
130
131
|
|
package/lib/exit-codes.js
CHANGED
|
@@ -5,7 +5,7 @@ const FAIL = 1;
|
|
|
5
5
|
const WAS_STOP = 2;
|
|
6
6
|
const UNHANDLED = 3;
|
|
7
7
|
const INVALID_OPTION = 4;
|
|
8
|
-
const
|
|
8
|
+
const SKIPED = 5;
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
OK,
|
|
@@ -13,6 +13,6 @@ module.exports = {
|
|
|
13
13
|
WAS_STOP,
|
|
14
14
|
UNHANDLED,
|
|
15
15
|
INVALID_OPTION,
|
|
16
|
-
|
|
16
|
+
SKIPED,
|
|
17
17
|
};
|
|
18
18
|
|
package/lib/operators.mjs
CHANGED
package/lib/supertape.d.ts
CHANGED
|
@@ -10,9 +10,14 @@ type Result = {
|
|
|
10
10
|
expected: unknown,
|
|
11
11
|
actual: unknown,
|
|
12
12
|
message: string,
|
|
13
|
+
output: string,
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
type
|
|
16
|
+
type Operator = {
|
|
17
|
+
[index: string]: (...args: any[]) => Result
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type Test = Operator & OperatorStub & {
|
|
16
21
|
equal: (result: unknown, expected: unknown, message?: string) => Result;
|
|
17
22
|
notEqual: (result: unknown, expected: unknown, message?: string) => Result;
|
|
18
23
|
deepEqual: (result: unknown, expected: unknown, message?: string) => Result;
|
|
@@ -41,10 +46,17 @@ declare namespace test {
|
|
|
41
46
|
|
|
42
47
|
export default test;
|
|
43
48
|
|
|
49
|
+
type CustomOperator = {
|
|
50
|
+
[index: string]: (operator: Operator) => (...args: any[]) => Result
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
declare function extend(customOperator: CustomOperator): typeof test;
|
|
54
|
+
|
|
44
55
|
export {
|
|
45
56
|
test,
|
|
46
57
|
Test,
|
|
47
58
|
stub,
|
|
48
59
|
Stub,
|
|
60
|
+
extend,
|
|
49
61
|
};
|
|
50
62
|
|
package/lib/supertape.js
CHANGED
package/lib/validator.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supertape",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.1",
|
|
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",
|