tape-six 1.7.12 → 1.7.13

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2005-2022 Eugene Lazutkin
1
+ Copyright 2005-2026 Eugene Lazutkin
2
2
 
3
3
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
4
 
package/README.md CHANGED
@@ -425,6 +425,7 @@ Test output can be controlled by flags. See [Supported flags](https://github.com
425
425
 
426
426
  The most recent releases:
427
427
 
428
+ - 1.7.13 _Replaced `process.exit()` / `Deno.exit()` with `process.exitCode` in test runners and `index.js` for graceful stdout flushing. Updated dependencies, GitHub Actions._
428
429
  - 1.7.12 _Added `--help`/`-h` and `--version`/`-v` options to all CLI utilities. Added flag documentation to help output._
429
430
  - 1.7.11 _Documentation consistency: added missing sequential test commands to AI docs, fixed test glob references._
430
431
  - 1.7.10 _Switched from workflows to Agent Skills (agentskills.io) for consumer integration. Improved CJS import docs._
package/bin/tape6-bun.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
+ import process from 'node:process';
3
4
  import {fileURLToPath} from 'node:url';
4
5
 
5
6
  import {
@@ -68,12 +69,16 @@ const main = async () => {
68
69
 
69
70
  if (currentOptions.optionFlags['--info'] === '') {
70
71
  showInfo(currentOptions, files);
71
- process.exit(0);
72
+ await new Promise(r => process.stdout.write('', r));
73
+ process.exitCode = 0;
74
+ return;
72
75
  }
73
76
 
74
77
  if (!files.length) {
75
78
  console.log('No files found.');
76
- process.exit(1);
79
+ await new Promise(r => process.stdout.write('', r));
80
+ process.exitCode = 1;
81
+ return;
77
82
  }
78
83
 
79
84
  const reporter = getReporter(),
@@ -94,7 +99,8 @@ const main = async () => {
94
99
  fail: hasFailed
95
100
  });
96
101
 
97
- process.exit(hasFailed ? 1 : 0);
102
+ await new Promise(r => process.stdout.write('', r));
103
+ process.exitCode = hasFailed ? 1 : 0;
98
104
  };
99
105
 
100
106
  main().catch(error => console.error('ERROR:', error));
package/bin/tape6-deno.js CHANGED
@@ -70,13 +70,15 @@ const main = async () => {
70
70
  if (currentOptions.optionFlags['--info'] === '') {
71
71
  showInfo(currentOptions, files);
72
72
  await new Promise(r => process.stdout.write('', r));
73
- Deno.exit(0);
73
+ process.exitCode = 0;
74
+ return;
74
75
  }
75
76
 
76
77
  if (!files.length) {
77
78
  console.log('No files found.');
78
79
  await new Promise(r => process.stdout.write('', r));
79
- Deno.exit(1);
80
+ process.exitCode = 1;
81
+ return;
80
82
  }
81
83
 
82
84
  const reporter = getReporter(),
@@ -98,7 +100,7 @@ const main = async () => {
98
100
  });
99
101
 
100
102
  await new Promise(r => process.stdout.write('', r));
101
- Deno.exit(hasFailed ? 1 : 0);
103
+ process.exitCode = hasFailed ? 1 : 0;
102
104
  };
103
105
 
104
106
  main().catch(error => console.error('ERROR:', error));
package/bin/tape6-node.js CHANGED
@@ -69,12 +69,16 @@ const main = async () => {
69
69
 
70
70
  if (currentOptions.optionFlags['--info'] === '') {
71
71
  showInfo(currentOptions, files);
72
- process.exit(0);
72
+ await new Promise(r => process.stdout.write('', r));
73
+ process.exitCode = 0;
74
+ return;
73
75
  }
74
76
 
75
77
  if (!files.length) {
76
78
  console.log('No files found.');
77
- process.exit(1);
79
+ await new Promise(r => process.stdout.write('', r));
80
+ process.exitCode = 1;
81
+ return;
78
82
  }
79
83
 
80
84
  const reporter = getReporter(),
@@ -95,7 +99,8 @@ const main = async () => {
95
99
  fail: hasFailed
96
100
  });
97
101
 
98
- process.exit(hasFailed ? 1 : 0);
102
+ await new Promise(r => process.stdout.write('', r));
103
+ process.exitCode = hasFailed ? 1 : 0;
99
104
  };
100
105
 
101
106
  main().catch(error => console.error('ERROR:', error));
package/bin/tape6-seq.js CHANGED
@@ -79,13 +79,15 @@ const main = async () => {
79
79
  if (currentOptions.optionFlags['--info'] === '') {
80
80
  showInfo(currentOptions, files);
81
81
  await new Promise(r => process.stdout.write('', r));
82
- process.exit(0);
82
+ process.exitCode = 0;
83
+ return;
83
84
  }
84
85
 
85
86
  if (!files.length) {
86
87
  console.log('No files found.');
87
88
  await new Promise(r => process.stdout.write('', r));
88
- process.exit(1);
89
+ process.exitCode = 1;
90
+ return;
89
91
  }
90
92
 
91
93
  const reporter = getReporter(),
@@ -107,7 +109,7 @@ const main = async () => {
107
109
  });
108
110
 
109
111
  await new Promise(r => process.stdout.write('', r));
110
- process.exit(hasFailed ? 1 : 0);
112
+ process.exitCode = hasFailed ? 1 : 0;
111
113
  };
112
114
 
113
115
  main().catch(error => console.error('ERROR:', error));
package/index.js CHANGED
@@ -46,6 +46,7 @@ const init = async () => {
46
46
  const isNode = typeof process == 'object' && process.versions?.node,
47
47
  isDeno = typeof Deno == 'object',
48
48
  isBun = typeof Bun == 'object',
49
+ isCli = isNode || isBun || isDeno,
49
50
  isBrowser = typeof window == 'object' && !!window.location,
50
51
  options = {};
51
52
 
@@ -74,7 +75,7 @@ const init = async () => {
74
75
 
75
76
  let originalConsole = null,
76
77
  setCurrentReporter = null;
77
- if (!options.noConsoleCapture && (isNode || isBun || isDeno)) {
78
+ if (!options.noConsoleCapture && isCli) {
78
79
  const {captureConsole, setCurrentReporter: setReporter} = await import(
79
80
  new URL('./src/utils/capture-console.js', import.meta.url)
80
81
  );
@@ -161,7 +162,7 @@ const init = async () => {
161
162
  setCurrentReporter?.(reporter);
162
163
  }
163
164
 
164
- return {options, isBrowser, isBun, isDeno, isNode};
165
+ return {options, isBrowser, isBun, isDeno, isNode, isCli};
165
166
  };
166
167
 
167
168
  const getTestFileName = ({isBrowser, isBun, isDeno, isNode}) => {
@@ -193,7 +194,7 @@ const testRunner = async () => {
193
194
  settings = await init();
194
195
  }
195
196
 
196
- const {isBrowser, isBun, isDeno, isNode} = settings,
197
+ const {isBrowser, isCli} = settings,
197
198
  reporter = getReporter(),
198
199
  testFileName = getTestFileName(settings);
199
200
 
@@ -235,13 +236,9 @@ const testRunner = async () => {
235
236
  fail: runHasFailed
236
237
  });
237
238
 
238
- if (!getConfiguredFlag()) {
239
- if (isDeno) {
240
- runHasFailed && Deno.exit(1);
241
- } else if (isBun) {
242
- runHasFailed && process.exit(1);
243
- } else if (isNode) {
244
- runHasFailed && process.exit(1);
239
+ if (!getConfiguredFlag() && runHasFailed) {
240
+ if (isCli) {
241
+ process.exitCode = 1;
245
242
  }
246
243
  }
247
244
  if (isBrowser && typeof __tape6_reportResults == 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tape-six",
3
- "version": "1.7.12",
3
+ "version": "1.7.13",
4
4
  "description": "TAP-inspired unit test library for Node, Deno, Bun, and browsers. ES modules, TypeScript, zero dependencies.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -104,6 +104,6 @@
104
104
  "@types/chai": "^5.2.3",
105
105
  "@types/node": "^25.5.0",
106
106
  "chai": "^6.2.2",
107
- "typescript": "^5.9.3"
107
+ "typescript": "^6.0.2"
108
108
  }
109
109
  }