supertape 10.4.0 → 10.5.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,13 @@
1
+ 2024.03.22, v10.5.0
2
+
3
+ feature:
4
+ - b4e7436 supertape: when cannot import parallel, try series (nodejs/node#52187)
5
+ - ebb9d46 supertape: remove dependency on deep-equal (#10)
6
+
1
7
  2024.03.07, v10.4.0
2
8
 
3
9
  feature:
4
- - 3aef569 supertape: remove dependency on deep-equal
10
+ - ebb9d46 supertape: remove dependency on deep-equal
5
11
 
6
12
  2024.03.01, v10.3.0
7
13
 
@@ -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
@@ -137,9 +137,14 @@ async function cli({argv, cwd, stdout, isStop, workerFormatter}) {
137
137
  const promises = [];
138
138
  const files = removeDuplicates(allFiles);
139
139
 
140
+ const resolvedNames = [];
141
+
142
+ // always resolve before import for windows
140
143
  for (const file of files) {
141
- // always resolve before import for windows
142
- const resolved = pathToFileURL(resolvePath(cwd, file));
144
+ resolvedNames.push(pathToFileURL(resolvePath(cwd, file)));
145
+ }
146
+
147
+ for (const resolved of resolvedNames) {
143
148
  promises.push(simpleImport(resolved));
144
149
  }
145
150
 
@@ -148,7 +153,12 @@ async function cli({argv, cwd, stdout, isStop, workerFormatter}) {
148
153
  if (!promises.length)
149
154
  return OK;
150
155
 
151
- await Promise.all(promises);
156
+ const [importError] = await tryToCatch(Promise.all.bind(Promise), promises);
157
+
158
+ if (importError)
159
+ for (const resolved of resolvedNames)
160
+ await simpleImport(resolved);
161
+
152
162
  const [result] = await once(supertape.run(), 'end');
153
163
 
154
164
  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)
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "10.4.0",
3
+ "version": "10.5.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",