tape-six 1.7.5 → 1.7.7

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 CHANGED
@@ -420,6 +420,8 @@ Test output can be controlled by flags. See [Supported flags](https://github.com
420
420
 
421
421
  The most recent releases:
422
422
 
423
+ - 1.7.7 _Bug fix: Windows path normalization in `tape6-server`, documented `--flags=FO` option form._
424
+ - 1.7.6 _Bug fix: `processArgs` alias canonicalization, dead code removal, doc fix._
423
425
  - 1.7.5 _Refactored CLI runners, added `--info` option, renamed `dontCaptureConsole` to `noConsoleCapture`._
424
426
  - 1.7.4 _Bug fixes: uncaught exception handling, `StopTest` suppression in parallel runners._
425
427
  - 1.7.3 _Bug fixes in reporters, runners, and assertions. Documentation corrections and improvements._
package/TESTING.md CHANGED
@@ -465,8 +465,11 @@ npx tape6 --flags FO # parallel (worker threads)
465
465
  npx tape6-seq --flags FO # sequential (in-process, no workers)
466
466
  npx tape6 --par 4 --flags FO # limit to 4 workers
467
467
  npx tape6 --info --flags FO # show config and exit without running tests
468
+ npx tape6 --flags=FO # = form is also supported
468
469
  ```
469
470
 
471
+ Options that take a value accept both space-separated (`--flags FO`) and `=`-separated (`--flags=FO`) forms. The `=` form does not support quoting (e.g. `--flags="FO"` won't work); use the space form when values need quoting.
472
+
470
473
  **`tape6` vs `tape6-seq`**: The default `tape6` runner spawns worker threads to run test files in parallel — faster, but each file runs in its own isolated context. `tape6-seq` runs all test files sequentially in a single process — slower, but useful for debugging, for tests that share state, or when worker threads are unavailable.
471
474
 
472
475
  ### Selected test files
@@ -515,6 +518,7 @@ Common combinations: `FO` (failures only + stop at first), `FOT` (+ show time).
515
518
  - `TAPE6_PAR` — number of parallel workers.
516
519
  - `TAPE6_TAP` — force TAP output format.
517
520
  - `TAPE6_JSONL` — force JSONL output format.
521
+ - `TAPE6_MIN` — force minimal output format.
518
522
 
519
523
  ## Configuring test discovery
520
524
 
@@ -10,6 +10,11 @@ import {getConfig, resolveTests, resolvePatterns} from '../src/utils/config.js';
10
10
 
11
11
  const fsp = fs.promises;
12
12
 
13
+ const toPosix = files =>
14
+ path.sep === path.win32.sep
15
+ ? files.map(f => f.replaceAll(path.win32.sep, path.posix.sep))
16
+ : files;
17
+
13
18
  // simple static server with no dependencies
14
19
 
15
20
  const showSelf = () => {
@@ -56,11 +61,12 @@ if (!webAppPath) {
56
61
  const url = import.meta.url;
57
62
  if (!/^file:\/\//i.test(url))
58
63
  throw Error('Cannot identify the location of the web application. Use WEBAPP_PATH.');
59
- const isWindows = path.sep === '\\';
60
64
  webAppPath = path.relative(
61
65
  rootFolder,
62
66
  path.join(path.dirname(fileURLToPath(url)), '../web-app/')
63
67
  );
68
+ if (path.sep === path.win32.sep)
69
+ webAppPath = webAppPath.replaceAll(path.win32.sep, path.posix.sep);
64
70
  }
65
71
 
66
72
  // common aliases
@@ -131,14 +137,19 @@ const server = http.createServer(async (req, res) => {
131
137
  const url = new URL(req.url, 'http://' + req.headers.host);
132
138
  if (url.pathname === '/--tests') {
133
139
  // get tests
134
- return sendJson(req, res, await resolveTests(rootFolder, 'browser'), method === 'HEAD');
140
+ return sendJson(
141
+ req,
142
+ res,
143
+ toPosix(await resolveTests(rootFolder, 'browser')),
144
+ method === 'HEAD'
145
+ );
135
146
  }
136
147
  if (url.pathname === '/--patterns') {
137
148
  // resolve patterns
138
149
  return sendJson(
139
150
  req,
140
151
  res,
141
- await resolvePatterns(rootFolder, url.searchParams.getAll('q')),
152
+ toPosix(await resolvePatterns(rootFolder, url.searchParams.getAll('q'))),
142
153
  method === 'HEAD'
143
154
  );
144
155
  }
@@ -172,7 +183,7 @@ const server = http.createServer(async (req, res) => {
172
183
  stat = await fsp.stat(altFile).catch(() => null);
173
184
  if (stat && stat.isFile()) return sendFile(req, res, altFile, '.html', method === 'HEAD');
174
185
  } else {
175
- url.pathname += path.sep;
186
+ url.pathname += path.posix.sep;
176
187
  return sendRedirect(req, res, url.href);
177
188
  }
178
189
  return bailOut(req, res);
package/llms-full.txt CHANGED
@@ -293,6 +293,7 @@ tape6 [--flags FLAGS] [--par N] [--info] [tests...]
293
293
  - `--par N` — number of parallel workers (default: all CPU cores).
294
294
  - `--info` — print current configuration and exit without running tests.
295
295
  - No arguments: runs tests from configuration.
296
+ - Options accept `--flags FO` or `--flags=FO`. The `=` form does not support quoting.
296
297
 
297
298
  ### tape6-seq
298
299
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tape-six",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "TAP-based unit test library for Node, Deno, Bun, and browsers. ES modules, TypeScript, zero dependencies.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -170,7 +170,13 @@ export const processArgs = argOptions => {
170
170
 
171
171
  const argNames = {};
172
172
  for (const argName of Object.keys(argOptions)) {
173
- const option = argOptions[argName];
173
+ let option = argOptions[argName];
174
+ if (typeof option == 'function') {
175
+ option = {fn: option, isValueRequired: true};
176
+ } else {
177
+ option = {...option};
178
+ }
179
+ option.canonicalName = argName;
174
180
  argNames[argName] = option;
175
181
  if (Array.isArray(option?.aliases)) {
176
182
  for (const alias of option.aliases) {
@@ -191,10 +197,6 @@ export const processArgs = argOptions => {
191
197
  continue;
192
198
  }
193
199
 
194
- if (typeof opt == 'function') {
195
- opt = {fn: opt, isValueRequired: true};
196
- }
197
-
198
200
  if (opt.isValueRequired && !values.length) {
199
201
  if (++i < args.length) {
200
202
  value = args[i];
@@ -206,7 +208,7 @@ export const processArgs = argOptions => {
206
208
  if (typeof opt.fn == 'function') {
207
209
  opt.fn(result.flags, name, value);
208
210
  } else {
209
- result.flags[name] = value;
211
+ result.flags[opt.canonicalName] = value;
210
212
  }
211
213
  }
212
214
 
@@ -313,8 +315,14 @@ export const showInfo = (options, files) => {
313
315
  console.log(' ' + (name + ':').padEnd(width), options.flags[name]);
314
316
  }
315
317
 
316
- console.log('Files (' + files.length + '):');
317
- for (const file of files) {
318
- console.log(' /' + file);
318
+ if (files) {
319
+ if (files.length) {
320
+ console.log('Files (' + files.length + '):');
321
+ for (const file of files) {
322
+ console.log(' /' + file);
323
+ }
324
+ } else {
325
+ console.log('Files: none');
326
+ }
319
327
  }
320
328
  };