@bitfab/sdk 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
|
@@ -42,7 +42,7 @@ var __version__;
|
|
|
42
42
|
var init_version_generated = __esm({
|
|
43
43
|
"src/version.generated.ts"() {
|
|
44
44
|
"use strict";
|
|
45
|
-
__version__ = "0.36.
|
|
45
|
+
__version__ = "0.36.13";
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -2586,20 +2586,17 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
2586
2586
|
includeOutputs,
|
|
2587
2587
|
includeRootOutput: false
|
|
2588
2588
|
});
|
|
2589
|
-
if (treeResponse.root) {
|
|
2590
|
-
mockTree = buildMockTree(treeResponse.root);
|
|
2591
|
-
} else if (mockStrategy === "all" || hasOverrides) {
|
|
2589
|
+
if (!treeResponse.root) {
|
|
2592
2590
|
throw new BitfabError(
|
|
2593
2591
|
`Replay mock strategy "${mockStrategy}"${hasOverrides ? " with overrides" : ""} requires a span tree root for original span ${originalSpanId}.`
|
|
2594
2592
|
);
|
|
2595
|
-
} else {
|
|
2596
|
-
mockTree = void 0;
|
|
2597
2593
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2594
|
+
mockTree = buildMockTree(treeResponse.root);
|
|
2595
|
+
} catch (error2) {
|
|
2596
|
+
if (mockStrategy !== "marked" || hasOverrides) {
|
|
2597
|
+
throw error2;
|
|
2601
2598
|
}
|
|
2602
|
-
mockTree =
|
|
2599
|
+
mockTree = { spans: /* @__PURE__ */ new Map() };
|
|
2603
2600
|
}
|
|
2604
2601
|
}
|
|
2605
2602
|
const outputCache = /* @__PURE__ */ new Map();
|
|
@@ -6174,7 +6171,12 @@ var Bitfab = class {
|
|
|
6174
6171
|
}
|
|
6175
6172
|
}
|
|
6176
6173
|
const shouldMock = replayCtxForMock.mockStrategy === "all" || replayCtxForMock.mockStrategy === "marked" && options.mockOnReplay === true;
|
|
6177
|
-
if (shouldMock && mockSpan) {
|
|
6174
|
+
if (shouldMock && !mockSpan) {
|
|
6175
|
+
throw new BitfabError(
|
|
6176
|
+
`Replay selected span "${traceFunctionKey}:${baseSpanParams.spanName}" for mocking, but recorded occurrence ${callIndex + 1} is unavailable. The real span was not executed.`
|
|
6177
|
+
);
|
|
6178
|
+
}
|
|
6179
|
+
if (shouldMock) {
|
|
6178
6180
|
const recorded = resolveRecordedOutput();
|
|
6179
6181
|
if (recorded instanceof Promise) {
|
|
6180
6182
|
return emitMockAsync(recorded, "recorded");
|