tape-six 1.7.6 → 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,7 @@ 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._
423
424
  - 1.7.6 _Bug fix: `processArgs` alias canonicalization, dead code removal, doc fix._
424
425
  - 1.7.5 _Refactored CLI runners, added `--info` option, renamed `dontCaptureConsole` to `noConsoleCapture`._
425
426
  - 1.7.4 _Bug fixes: uncaught exception handling, `StopTest` suppression in parallel runners._
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
@@ -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.6",
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",
@@ -315,8 +315,14 @@ export const showInfo = (options, files) => {
315
315
  console.log(' ' + (name + ':').padEnd(width), options.flags[name]);
316
316
  }
317
317
 
318
- console.log('Files (' + files.length + '):');
319
- for (const file of files) {
320
- 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
+ }
321
327
  }
322
328
  };