bitfab 0.36.12 → 0.36.13
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-VUYTATF5.js → chunk-VOUV7ZTS.js} +8 -11
- package/dist/chunk-VOUV7ZTS.js.map +1 -0
- package/dist/{chunk-OCJSHTJR.js → chunk-XAQJOZMJ.js} +9 -4
- package/dist/{chunk-OCJSHTJR.js.map → chunk-XAQJOZMJ.js.map} +1 -1
- package/dist/index.cjs +13 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -14
- package/dist/index.d.ts +20 -14
- package/dist/index.js +2 -2
- package/dist/node.cjs +13 -11
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-P35CUNGH.js → replay-WHZFV6OB.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-VUYTATF5.js.map +0 -1
- /package/dist/{replay-P35CUNGH.js.map → replay-WHZFV6OB.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ var __version__;
|
|
|
51
51
|
var init_version_generated = __esm({
|
|
52
52
|
"src/version.generated.ts"() {
|
|
53
53
|
"use strict";
|
|
54
|
-
__version__ = "0.36.
|
|
54
|
+
__version__ = "0.36.13";
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
|
|
@@ -2595,20 +2595,17 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
2595
2595
|
includeOutputs,
|
|
2596
2596
|
includeRootOutput: false
|
|
2597
2597
|
});
|
|
2598
|
-
if (treeResponse.root) {
|
|
2599
|
-
mockTree = buildMockTree(treeResponse.root);
|
|
2600
|
-
} else if (mockStrategy === "all" || hasOverrides) {
|
|
2598
|
+
if (!treeResponse.root) {
|
|
2601
2599
|
throw new BitfabError(
|
|
2602
2600
|
`Replay mock strategy "${mockStrategy}"${hasOverrides ? " with overrides" : ""} requires a span tree root for original span ${originalSpanId}.`
|
|
2603
2601
|
);
|
|
2604
|
-
} else {
|
|
2605
|
-
mockTree = void 0;
|
|
2606
2602
|
}
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2603
|
+
mockTree = buildMockTree(treeResponse.root);
|
|
2604
|
+
} catch (error2) {
|
|
2605
|
+
if (mockStrategy !== "marked" || hasOverrides) {
|
|
2606
|
+
throw error2;
|
|
2610
2607
|
}
|
|
2611
|
-
mockTree =
|
|
2608
|
+
mockTree = { spans: /* @__PURE__ */ new Map() };
|
|
2612
2609
|
}
|
|
2613
2610
|
}
|
|
2614
2611
|
const outputCache = /* @__PURE__ */ new Map();
|
|
@@ -6183,7 +6180,12 @@ var Bitfab = class {
|
|
|
6183
6180
|
}
|
|
6184
6181
|
}
|
|
6185
6182
|
const shouldMock = replayCtxForMock.mockStrategy === "all" || replayCtxForMock.mockStrategy === "marked" && options.mockOnReplay === true;
|
|
6186
|
-
if (shouldMock && mockSpan) {
|
|
6183
|
+
if (shouldMock && !mockSpan) {
|
|
6184
|
+
throw new BitfabError(
|
|
6185
|
+
`Replay selected span "${traceFunctionKey}:${baseSpanParams.spanName}" for mocking, but recorded occurrence ${callIndex + 1} is unavailable. The real span was not executed.`
|
|
6186
|
+
);
|
|
6187
|
+
}
|
|
6188
|
+
if (shouldMock) {
|
|
6187
6189
|
const recorded = resolveRecordedOutput();
|
|
6188
6190
|
if (recorded instanceof Promise) {
|
|
6189
6191
|
return emitMockAsync(recorded, "recorded");
|