tape-six-proc 1.2.3 → 1.2.4
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 -7
- package/bin/tape6-proc-node.js +4 -3
- package/llms-full.txt +4 -3
- package/llms.txt +4 -3
- package/package.json +18 -15
- package/src/TestWorker.js +7 -11
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ and supports TypeScript natively without transpilation.
|
|
|
10
10
|
## Why?
|
|
11
11
|
|
|
12
12
|
The standard `tape6` runner uses worker threads. `tape6-proc` spawns each test file
|
|
13
|
-
in its own subprocess instead, providing full process isolation. This prevents shared
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
in its own subprocess instead, providing full process isolation. This prevents shared-state
|
|
14
|
+
leaks and is useful when tests need a clean environment. TypeScript test files (`.ts`)
|
|
15
|
+
run natively on modern Node, Deno, and Bun — no transpilation needed.
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
18
|
|
|
@@ -66,11 +66,10 @@ npm test
|
|
|
66
66
|
|
|
67
67
|
## Docs
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
See the [wiki](https://github.com/uhop/tape-six-proc/wiki) for full documentation.
|
|
70
70
|
`tape-six` has its own [wiki](https://github.com/uhop/tape-six/wiki).
|
|
71
71
|
|
|
72
|
-
`tape-six-proc` uses the same test configuration as `tape-six`.
|
|
73
|
-
has the same usage as `tape6`.
|
|
72
|
+
`tape-six-proc` uses the same test configuration and CLI conventions as `tape-six`.
|
|
74
73
|
|
|
75
74
|
### Command-line utilities
|
|
76
75
|
|
|
@@ -89,6 +88,7 @@ LLM-friendly documentation is available:
|
|
|
89
88
|
|
|
90
89
|
The most recent releases:
|
|
91
90
|
|
|
91
|
+
- 1.2.4 _Synchronized with `tape-six` 1.7.4. Added Min reporter support. Improved docs and npm keywords._
|
|
92
92
|
- 1.2.3 _Updated dependencies, cleaned up docs, added AI-friendly links and TS info._
|
|
93
93
|
- 1.2.2 _Synchronized the implementation with `tape-six` 1.7.0._
|
|
94
94
|
- 1.2.1 _Synchronized the implementation with `tape-six` 1.5.1._
|
|
@@ -104,4 +104,4 @@ The most recent releases:
|
|
|
104
104
|
- 1.0.1 _Updated dependencies._
|
|
105
105
|
- 1.0.0 _The first official release._
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
See the full [release notes](https://github.com/uhop/tape-six-proc/wiki/Release-notes) for details.
|
package/bin/tape6-proc-node.js
CHANGED
|
@@ -142,9 +142,10 @@ const main = async () => {
|
|
|
142
142
|
await init();
|
|
143
143
|
await selectTimer();
|
|
144
144
|
|
|
145
|
-
process.on('uncaughtException', (error, origin) =>
|
|
146
|
-
console.error('UNHANDLED ERROR:', origin, error)
|
|
147
|
-
|
|
145
|
+
process.on('uncaughtException', (error, origin) => {
|
|
146
|
+
console.error('UNHANDLED ERROR:', origin, error);
|
|
147
|
+
process.exit(1);
|
|
148
|
+
});
|
|
148
149
|
|
|
149
150
|
if (!files.length) {
|
|
150
151
|
console.log('No files found.');
|
package/llms-full.txt
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
- Drop-in replacement for `tape6` (worker-thread runner)
|
|
9
9
|
- Same configuration format as `tape-six`
|
|
10
10
|
- Parallel execution with configurable concurrency
|
|
11
|
-
- TAP, TTY (colored), and
|
|
11
|
+
- TAP, TTY (colored), JSONL, and minimal output formats
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -145,6 +145,7 @@ Environment-specific subsections (`node`, `deno`, `bun`) are supported. The runn
|
|
|
145
145
|
- `TAPE6_PAR` — number of parallel processes (overridden by `--par`).
|
|
146
146
|
- `TAPE6_TAP` — force TAP reporter (any non-empty value).
|
|
147
147
|
- `TAPE6_JSONL` — force JSONL reporter (any non-empty value).
|
|
148
|
+
- `TAPE6_MIN` — force minimal reporter (any non-empty value).
|
|
148
149
|
- `TAPE6_TEST` — set by the runner: unique ID for each spawned test process.
|
|
149
150
|
- `TAPE6_TEST_FILE_NAME` — set by the runner: file name of the current test.
|
|
150
151
|
- `TAPE6_JSONL_PREFIX` — set by the runner: UUID prefix for JSONL lines in stdout.
|
|
@@ -161,7 +162,7 @@ Environment-specific subsections (`node`, `deno`, `bun`) are supported. The runn
|
|
|
161
162
|
### Main CLI (`bin/tape6-proc-node.js`)
|
|
162
163
|
|
|
163
164
|
1. Parses CLI arguments (`--flags`, `--par`, `--runFileArgs`, positional test patterns).
|
|
164
|
-
2. Selects reporter: TTY (default for terminals), TAP, or
|
|
165
|
+
2. Selects reporter: TTY (default for terminals), TAP, JSONL, or Min (based on environment variables).
|
|
165
166
|
3. Resolves test files from configuration or CLI patterns using `tape-six/utils/config.js`.
|
|
166
167
|
4. Creates a `TestWorker` instance and executes all test files.
|
|
167
168
|
5. Reports final results and exits with code 0 (success) or 1 (failures).
|
|
@@ -204,7 +205,7 @@ process.stderr → TextDecoderStream → lines → wrap-lines → report
|
|
|
204
205
|
|
|
205
206
|
## Dependencies
|
|
206
207
|
|
|
207
|
-
- **`tape-six`** — the core test library. Imports: `State.js`, `utils/EventServer.js`, `utils/makeDeferred.js`, `utils/config.js`, `test.js`, reporters (`
|
|
208
|
+
- **`tape-six`** — the core test library. Imports: `State.js`, `utils/EventServer.js`, `utils/makeDeferred.js`, `utils/config.js`, `test.js`, reporters (`TTYReporter`, `TapReporter`, `JSONLReporter`, `MinReporter`), `utils/timer.js`.
|
|
208
209
|
- **`dollar-shell`** — cross-runtime process spawning. Imports: `spawn`, `currentExecPath`, `runFileArgs`.
|
|
209
210
|
|
|
210
211
|
## Writing tests
|
package/llms.txt
CHANGED
|
@@ -51,9 +51,9 @@ tape6-proc [--flags FLAGS] [--par N] [--runFileArgs ARGS] [tests...]
|
|
|
51
51
|
|
|
52
52
|
### Options
|
|
53
53
|
|
|
54
|
-
- `--flags FLAGS` (`-f`) — output control flags (same as tape6: F=failures only, T=time, B=banner, D=data, O=fail once, N=assert number, M=monochrome, C=don't capture console, H=hide streams).
|
|
54
|
+
- `--flags FLAGS` (`-f`) — output control flags (same as tape6: F=failures only, T=time, B=banner, D=data, O=fail once, N=assert number, M=monochrome, C=don't capture console, H=hide streams). Can be specified multiple times.
|
|
55
55
|
- `--par N` (`-p`) — number of parallel processes (default: all CPU cores).
|
|
56
|
-
- `--runFileArgs ARGS` (`-r`) — extra arguments
|
|
56
|
+
- `--runFileArgs ARGS` (`-r`) — extra arguments for the spawned interpreter. Can be specified multiple times. Mainly for Deno permissions.
|
|
57
57
|
- `--self` — prints the path to `tape6-proc.js` (for cross-runtime scripts).
|
|
58
58
|
- No arguments: runs tests from configuration.
|
|
59
59
|
|
|
@@ -97,7 +97,8 @@ Environment-specific subsections: `node`, `deno`, `bun`.
|
|
|
97
97
|
- `TAPE6_PAR` — number of parallel processes.
|
|
98
98
|
- `TAPE6_TAP` — force TAP reporter.
|
|
99
99
|
- `TAPE6_JSONL` — force JSONL reporter.
|
|
100
|
-
- `
|
|
100
|
+
- `TAPE6_MIN` — force minimal reporter.
|
|
101
|
+
- `TAPE6_TEST_FILE_NAME` — set by the runner: file name of the current test.
|
|
101
102
|
|
|
102
103
|
## Links
|
|
103
104
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tape-six-proc",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.4",
|
|
4
|
+
"description": "Process-isolated test runner for tape-six. Runs each test file in its own subprocess. Works with Node, Deno, and Bun. Supports TypeScript without transpilation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tape6-proc": "bin/tape6-proc.js"
|
|
@@ -15,22 +15,25 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"tap",
|
|
18
|
+
"tape6",
|
|
19
|
+
"tape-six",
|
|
18
20
|
"test",
|
|
19
|
-
"
|
|
20
|
-
"assert",
|
|
21
|
-
"process",
|
|
21
|
+
"test-runner",
|
|
22
22
|
"unit-test",
|
|
23
23
|
"testing",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
24
|
+
"harness",
|
|
25
|
+
"process",
|
|
26
|
+
"subprocess",
|
|
27
|
+
"isolation",
|
|
28
|
+
"parallel",
|
|
29
|
+
"cross-runtime",
|
|
30
|
+
"nodejs",
|
|
27
31
|
"deno",
|
|
28
32
|
"bun",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"typescript"
|
|
33
|
+
"esm",
|
|
34
|
+
"es-modules",
|
|
35
|
+
"typescript",
|
|
36
|
+
"no-transpile"
|
|
34
37
|
],
|
|
35
38
|
"author": "Eugene Lazutkin <eugene.lazutkin@gmail.com> (https://www.lazutkin.com)",
|
|
36
39
|
"funding": "https://github.com/sponsors/uhop",
|
|
@@ -53,8 +56,8 @@
|
|
|
53
56
|
"llms-full.txt"
|
|
54
57
|
],
|
|
55
58
|
"dependencies": {
|
|
56
|
-
"dollar-shell": "^1.1.
|
|
57
|
-
"tape-six": "^1.7.
|
|
59
|
+
"dollar-shell": "^1.1.10",
|
|
60
|
+
"tape-six": "^1.7.4"
|
|
58
61
|
},
|
|
59
62
|
"tape6": {
|
|
60
63
|
"tests": [
|
package/src/TestWorker.js
CHANGED
|
@@ -91,17 +91,13 @@ export default class TestWorker extends EventServer {
|
|
|
91
91
|
reason.push(`signal: ${worker.signalCode}`);
|
|
92
92
|
}
|
|
93
93
|
if (reason.length) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
});
|
|
102
|
-
} catch (error) {
|
|
103
|
-
if (!isStopTest(error)) throw error;
|
|
104
|
-
}
|
|
94
|
+
self.report(id, {
|
|
95
|
+
name: 'process has failed, ' + reason.join(', '),
|
|
96
|
+
test: 0,
|
|
97
|
+
marker: new Error(),
|
|
98
|
+
operator: 'error',
|
|
99
|
+
fail: true
|
|
100
|
+
});
|
|
105
101
|
self.report(id, {type: 'terminated', test: 0, name: 'FILE: /' + fileName});
|
|
106
102
|
}
|
|
107
103
|
}
|