supertape 11.0.4 → 11.1.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 +5 -0
- package/bin/subscribe.mjs +2 -2
- package/lib/cli.js +20 -8
- package/package.json +2 -2
package/ChangeLog
CHANGED
package/bin/subscribe.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {keypress} from '@putout/cli-keypress';
|
|
2
2
|
import {parse} from 'flatted';
|
|
3
3
|
import harnessCreator from '../lib/formatter/harness.js';
|
|
4
4
|
import {
|
|
@@ -14,7 +14,7 @@ const {createHarness} = harnessCreator;
|
|
|
14
14
|
const resolveFormatter = async (name) => await import(`@supertape/formatter-${name}`);
|
|
15
15
|
|
|
16
16
|
export async function subscribe({name, exit, worker, stdout}) {
|
|
17
|
-
const {isStop} =
|
|
17
|
+
const {isStop} = keypress();
|
|
18
18
|
const harness = createHarness(await resolveFormatter(name));
|
|
19
19
|
|
|
20
20
|
harness.pipe(stdout);
|
package/lib/cli.js
CHANGED
|
@@ -8,11 +8,11 @@ const {pathToFileURL} = require('node:url');
|
|
|
8
8
|
const glob = require('glob');
|
|
9
9
|
const fullstore = require('fullstore');
|
|
10
10
|
const tryToCatch = require('try-to-catch');
|
|
11
|
-
const keypress = require('@putout/cli-keypress');
|
|
11
|
+
const {keypress: _keypress} = require('@putout/cli-keypress');
|
|
12
12
|
|
|
13
13
|
const {parseArgs, yargsOptions} = require('./cli/parse-args');
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const _supertape = require('..');
|
|
16
16
|
const {
|
|
17
17
|
OK,
|
|
18
18
|
FAIL,
|
|
@@ -31,10 +31,22 @@ const {
|
|
|
31
31
|
SUPERTAPE_CHECK_SKIPPED = '0',
|
|
32
32
|
} = process.env;
|
|
33
33
|
|
|
34
|
-
module.exports = async (
|
|
35
|
-
|
|
34
|
+
module.exports = async (overrides = {}) => {
|
|
35
|
+
const {
|
|
36
|
+
argv,
|
|
37
|
+
cwd,
|
|
38
|
+
stdout,
|
|
39
|
+
stderr,
|
|
40
|
+
exit,
|
|
41
|
+
workerFormatter,
|
|
42
|
+
keypress = _keypress,
|
|
43
|
+
supertape = _supertape,
|
|
44
|
+
} = overrides;
|
|
45
|
+
|
|
46
|
+
const isStop = overrides.isStop || keypress().isStop;
|
|
36
47
|
|
|
37
48
|
const [error, result] = await tryToCatch(cli, {
|
|
49
|
+
supertape,
|
|
38
50
|
argv,
|
|
39
51
|
cwd,
|
|
40
52
|
stdout,
|
|
@@ -55,6 +67,9 @@ module.exports = async ({argv, cwd, stdout, stderr, exit, isStop, workerFormatte
|
|
|
55
67
|
skipped,
|
|
56
68
|
} = result;
|
|
57
69
|
|
|
70
|
+
if (isStop())
|
|
71
|
+
return exit(WAS_STOP);
|
|
72
|
+
|
|
58
73
|
if (Number(SUPERTAPE_CHECK_SKIPPED) && skipped)
|
|
59
74
|
return exit(SKIPPED);
|
|
60
75
|
|
|
@@ -66,13 +81,10 @@ module.exports = async ({argv, cwd, stdout, stderr, exit, isStop, workerFormatte
|
|
|
66
81
|
return exit(code);
|
|
67
82
|
}
|
|
68
83
|
|
|
69
|
-
if (isStop())
|
|
70
|
-
return exit(WAS_STOP);
|
|
71
|
-
|
|
72
84
|
return exit(OK);
|
|
73
85
|
};
|
|
74
86
|
|
|
75
|
-
async function cli({argv, cwd, stdout, isStop, workerFormatter}) {
|
|
87
|
+
async function cli({argv, cwd, stdout, isStop, workerFormatter, supertape}) {
|
|
76
88
|
const args = parseArgs(argv);
|
|
77
89
|
|
|
78
90
|
if (args.version) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supertape",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.1.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",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@cloudcmd/stub": "^4.0.0",
|
|
43
|
-
"@putout/cli-keypress": "^
|
|
43
|
+
"@putout/cli-keypress": "^3.0.0",
|
|
44
44
|
"@putout/cli-validate-args": "^2.0.0",
|
|
45
45
|
"@supertape/engine-loader": "^2.0.0",
|
|
46
46
|
"@supertape/formatter-fail": "^4.0.0",
|