bitfab 0.24.1 → 0.25.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/dist/{chunk-J4D6PRM4.js → chunk-GQLNEYSU.js} +3 -3
- package/dist/{chunk-J4D6PRM4.js.map → chunk-GQLNEYSU.js.map} +1 -1
- package/dist/index.cjs +25 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +1 -1
- package/dist/node.cjs +25 -4
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/{replay-NMQA7XY6.js → replay-KYGI6LJY.js} +25 -4
- package/dist/replay-KYGI6LJY.js.map +1 -0
- package/package.json +1 -1
- package/dist/replay-NMQA7XY6.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -422,13 +422,15 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
422
422
|
dbSnapshotRef: serverItem.dbSnapshotRef ?? null
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
async function mapWithConcurrency(tasks, maxConcurrency) {
|
|
425
|
+
async function mapWithConcurrency(tasks, maxConcurrency, onSettled) {
|
|
426
426
|
const results = new Array(tasks.length);
|
|
427
427
|
let nextIndex = 0;
|
|
428
428
|
async function worker() {
|
|
429
429
|
while (nextIndex < tasks.length) {
|
|
430
430
|
const index = nextIndex++;
|
|
431
|
-
|
|
431
|
+
const result = await tasks[index]();
|
|
432
|
+
results[index] = result;
|
|
433
|
+
onSettled?.(result, index);
|
|
432
434
|
}
|
|
433
435
|
}
|
|
434
436
|
const workers = Array.from(
|
|
@@ -488,7 +490,26 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
|
|
|
488
490
|
options?.adaptInputs
|
|
489
491
|
)
|
|
490
492
|
);
|
|
491
|
-
const
|
|
493
|
+
const total = tasks.length;
|
|
494
|
+
let completed = 0;
|
|
495
|
+
let succeeded = 0;
|
|
496
|
+
let errored = 0;
|
|
497
|
+
const resultItems = await mapWithConcurrency(
|
|
498
|
+
tasks,
|
|
499
|
+
maxConcurrency,
|
|
500
|
+
options?.onProgress ? (item) => {
|
|
501
|
+
completed += 1;
|
|
502
|
+
if (item.error === null) {
|
|
503
|
+
succeeded += 1;
|
|
504
|
+
} else {
|
|
505
|
+
errored += 1;
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
options?.onProgress?.({ completed, total, succeeded, errored });
|
|
509
|
+
} catch {
|
|
510
|
+
}
|
|
511
|
+
} : void 0
|
|
512
|
+
);
|
|
492
513
|
const completeResult = await httpClient.completeReplay(testRunId);
|
|
493
514
|
const serverTraceIds = completeResult.traceIds;
|
|
494
515
|
const replayTokens = completeResult.tokens;
|
|
@@ -575,7 +596,7 @@ __export(index_exports, {
|
|
|
575
596
|
module.exports = __toCommonJS(index_exports);
|
|
576
597
|
|
|
577
598
|
// src/version.generated.ts
|
|
578
|
-
var __version__ = "0.
|
|
599
|
+
var __version__ = "0.25.0";
|
|
579
600
|
|
|
580
601
|
// src/constants.ts
|
|
581
602
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|