supertape 10.4.0 → 10.6.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 CHANGED
@@ -1,7 +1,21 @@
1
+ 2024.05.09, v10.6.0
2
+
3
+ feature:
4
+ - 81503f1 supertape: eslint-plugin-n: drop
5
+ - 2a378d1 supertape: pullout v5.0.1
6
+ - 68a1fa9 supertape: formatter: harness: readableObjectMode: rm
7
+ - 41af461 supertape: eslint v9.1.1
8
+
9
+ 2024.03.22, v10.5.0
10
+
11
+ feature:
12
+ - b4e7436 supertape: when cannot import parallel, try series (nodejs/node#52187)
13
+ - ebb9d46 supertape: remove dependency on deep-equal (#10)
14
+
1
15
  2024.03.07, v10.4.0
2
16
 
3
17
  feature:
4
- - 3aef569 supertape: remove dependency on deep-equal
18
+ - ebb9d46 supertape: remove dependency on deep-equal
5
19
 
6
20
  2024.03.01, v10.3.0
7
21
 
@@ -1,8 +1,5 @@
1
1
  import {EventEmitter} from 'node:events';
2
- import {
3
- parentPort,
4
- workerData,
5
- } from 'node:worker_threads';
2
+ import {parentPort, workerData} from 'node:worker_threads';
6
3
 
7
4
  const {assign} = Object;
8
5
 
package/lib/cli.js CHANGED
@@ -1,16 +1,15 @@
1
1
  'use strict';
2
2
 
3
- const process = require('process');
4
- const {resolve: resolvePath} = require('path');
5
- const {once} = require('events');
6
- const {pathToFileURL} = require('url');
3
+ const process = require('node:process');
4
+ const {resolve: resolvePath} = require('node:path');
5
+ const {once} = require('node:events');
6
+ const {pathToFileURL} = require('node:url');
7
7
 
8
8
  const glob = require('glob');
9
9
  const fullstore = require('fullstore');
10
10
  const tryToCatch = require('try-to-catch');
11
11
  const keypress = require('@putout/cli-keypress');
12
12
 
13
- const {simpleImport} = require('./simple-import');
14
13
  const {parseArgs, yargsOptions} = require('./cli/parse-args');
15
14
 
16
15
  const supertape = require('..');
@@ -137,10 +136,15 @@ async function cli({argv, cwd, stdout, isStop, workerFormatter}) {
137
136
  const promises = [];
138
137
  const files = removeDuplicates(allFiles);
139
138
 
139
+ const resolvedNames = [];
140
+
141
+ // always resolve before import for windows
140
142
  for (const file of files) {
141
- // always resolve before import for windows
142
- const resolved = pathToFileURL(resolvePath(cwd, file));
143
- promises.push(simpleImport(resolved));
143
+ resolvedNames.push(pathToFileURL(resolvePath(cwd, file)));
144
+ }
145
+
146
+ for (const resolved of resolvedNames) {
147
+ promises.push(import(resolved));
144
148
  }
145
149
 
146
150
  filesCount(files.length);
@@ -148,7 +152,12 @@ async function cli({argv, cwd, stdout, isStop, workerFormatter}) {
148
152
  if (!promises.length)
149
153
  return OK;
150
154
 
151
- await Promise.all(promises);
155
+ const [importError] = await tryToCatch(Promise.all.bind(Promise), promises);
156
+
157
+ if (importError)
158
+ for (const resolved of resolvedNames)
159
+ await import(resolved);
160
+
152
161
  const [result] = await once(supertape.run(), 'end');
153
162
 
154
163
  return result;
package/lib/diff.mjs CHANGED
@@ -1,9 +1,6 @@
1
1
  import {diff} from 'jest-diff';
2
2
  import strip from 'strip-ansi';
3
- import {
4
- formatOutput,
5
- addSpaces,
6
- } from './format.js';
3
+ import {formatOutput, addSpaces} from './format.js';
7
4
 
8
5
  export default (a, b) => {
9
6
  const diffed = diff(a, b)
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const {Transform} = require('stream');
3
+ const {Transform: _Transform} = require('node:stream');
4
4
  const {assign} = Object;
5
5
 
6
- module.exports.createHarness = (reporter) => {
6
+ module.exports.createHarness = (reporter, {Transform = _Transform} = {}) => {
7
7
  const prepared = prepare(reporter);
8
8
  const stream = new Transform({
9
- readableObjectMode: true,
10
9
  writableObjectMode: true,
11
10
 
12
11
  transform(chunk, encoding, callback) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {EventEmitter} = require('events');
3
+ const {EventEmitter} = require('node:events');
4
4
  const {createHarness} = require('./harness');
5
5
 
6
6
  const resolveFormatter = async (name) => await import(`@supertape/formatter-${name}`);
package/lib/is-debug.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const process = require('process');
3
+ const process = require('node:process');
4
4
  const argv = process.execArgv.join();
5
5
 
6
6
  module.exports = argv.includes('inspect') || argv.includes('debug');
package/lib/operators.mjs CHANGED
@@ -1,9 +1,6 @@
1
1
  import {isDeepStrictEqual} from 'node:util';
2
2
  import diff from './diff.mjs';
3
- import {
4
- formatOutput,
5
- parseAt,
6
- } from './format.js';
3
+ import {formatOutput, parseAt} from './format.js';
7
4
 
8
5
  const {entries} = Object;
9
6
  const isAsync = (a) => a[Symbol.toStringTag] === 'AsyncFunction';
@@ -1,8 +1,5 @@
1
1
  import {OperatorStub} from '@supertape/operator-stub';
2
- import {
3
- stub,
4
- Stub,
5
- } from '@cloudcmd/stub';
2
+ import {stub, Stub} from '@cloudcmd/stub';
6
3
 
7
4
  type OperationBaseResult = {
8
5
  is: boolean;
package/lib/supertape.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const process = require('process');
4
- const {EventEmitter} = require('events');
5
- const {PassThrough} = require('stream');
3
+ const process = require('node:process');
4
+ const {EventEmitter} = require('node:events');
5
+ const {PassThrough} = require('node:stream');
6
6
 
7
7
  const stub = require('@cloudcmd/stub');
8
8
  const once = require('once');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "10.4.0",
3
+ "version": "10.6.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",
@@ -75,18 +75,18 @@
75
75
  "devDependencies": {
76
76
  "@babel/core": "^8.0.0-alpha.5",
77
77
  "@iocmd/wait": "^2.1.0",
78
+ "@putout/eslint-flat": "^1.0.4",
78
79
  "c8": "^9.0.0",
79
80
  "check-dts": "^0.7.0",
80
81
  "currify": "^4.0.0",
81
- "eslint": "^8.0.0",
82
- "eslint-plugin-n": "^16.0.1",
82
+ "eslint": "^9.1.1",
83
83
  "eslint-plugin-putout": "^22.0.0",
84
84
  "find-up": "^7.0.0",
85
85
  "madrun": "^10.0.0",
86
86
  "mock-require": "^3.0.2",
87
87
  "montag": "^1.0.0",
88
88
  "nodemon": "^3.0.1",
89
- "pullout": "^4.0.0",
89
+ "pullout": "^5.0.1",
90
90
  "putout": "^35.0.0",
91
91
  "runsome": "^1.0.0",
92
92
  "try-catch": "^3.0.0",
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports.simpleImport = (a) => import(a);