@bitfab/sdk 0.36.11 → 0.36.12
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-VDFPZYLH.js → chunk-OCJSHTJR.js} +24 -12
- package/dist/chunk-OCJSHTJR.js.map +1 -0
- package/dist/{chunk-EKOAKLZC.js → chunk-VUYTATF5.js} +2 -2
- package/dist/{chunk-EKOAKLZC.js.map → chunk-VUYTATF5.js.map} +1 -1
- package/dist/index.cjs +22 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/node.cjs +22 -10
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-TW3ONJ3W.js → replay-P35CUNGH.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-VDFPZYLH.js.map +0 -1
- /package/dist/{replay-TW3ONJ3W.js.map → replay-P35CUNGH.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
toJsonSafe,
|
|
17
17
|
toJsonSafeReport,
|
|
18
18
|
warnOnce
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VUYTATF5.js";
|
|
20
20
|
|
|
21
21
|
// src/processorPayload.ts
|
|
22
22
|
var SERIALIZATION_DEGRADED_STEP = "serialization_degraded";
|
|
@@ -2978,14 +2978,19 @@ var Bitfab = class {
|
|
|
2978
2978
|
counters.set(counterKey, callIndex + 1);
|
|
2979
2979
|
const mockKey = `${counterKey}:${callIndex}`;
|
|
2980
2980
|
const mockSpan = replayCtxForMock.mockTree.spans.get(mockKey);
|
|
2981
|
-
const emitMock = (output) => {
|
|
2982
|
-
void sendSpan({
|
|
2981
|
+
const emitMock = (output, mockSource) => {
|
|
2982
|
+
void sendSpan({
|
|
2983
|
+
result: output,
|
|
2984
|
+
mocked: true,
|
|
2985
|
+
mockTarget: "output",
|
|
2986
|
+
mockSource
|
|
2987
|
+
});
|
|
2983
2988
|
if (fnReturnsPromise) {
|
|
2984
2989
|
return Promise.resolve(output);
|
|
2985
2990
|
}
|
|
2986
2991
|
return output;
|
|
2987
2992
|
};
|
|
2988
|
-
const emitMockAsync = (pending) => {
|
|
2993
|
+
const emitMockAsync = (pending, mockSource) => {
|
|
2989
2994
|
if (!fnReturnsPromise) {
|
|
2990
2995
|
throw new BitfabError(
|
|
2991
2996
|
`Cannot mock synchronous span "${traceFunctionKey}" with an asynchronously-resolved value (lazy recorded-output fetch or an async value function). Make the wrapped function async, or use mock: "all" so recorded outputs are fetched eagerly.`
|
|
@@ -2993,7 +2998,12 @@ var Bitfab = class {
|
|
|
2993
2998
|
}
|
|
2994
2999
|
return (async () => {
|
|
2995
3000
|
const output = await pending;
|
|
2996
|
-
void sendSpan({
|
|
3001
|
+
void sendSpan({
|
|
3002
|
+
result: output,
|
|
3003
|
+
mocked: true,
|
|
3004
|
+
mockTarget: "output",
|
|
3005
|
+
mockSource
|
|
3006
|
+
});
|
|
2997
3007
|
return output;
|
|
2998
3008
|
})();
|
|
2999
3009
|
};
|
|
@@ -3035,18 +3045,18 @@ var Bitfab = class {
|
|
|
3035
3045
|
getOriginalOutput: () => Promise.resolve(resolveRecordedOutput())
|
|
3036
3046
|
});
|
|
3037
3047
|
if (injected instanceof Promise) {
|
|
3038
|
-
return emitMockAsync(injected);
|
|
3048
|
+
return emitMockAsync(injected, "override");
|
|
3039
3049
|
}
|
|
3040
|
-
return emitMock(injected);
|
|
3050
|
+
return emitMock(injected, "override");
|
|
3041
3051
|
}
|
|
3042
3052
|
}
|
|
3043
3053
|
const shouldMock = replayCtxForMock.mockStrategy === "all" || replayCtxForMock.mockStrategy === "marked" && options.mockOnReplay === true;
|
|
3044
3054
|
if (shouldMock && mockSpan) {
|
|
3045
3055
|
const recorded = resolveRecordedOutput();
|
|
3046
3056
|
if (recorded instanceof Promise) {
|
|
3047
|
-
return emitMockAsync(recorded);
|
|
3057
|
+
return emitMockAsync(recorded, "recorded");
|
|
3048
3058
|
}
|
|
3049
|
-
return emitMock(recorded);
|
|
3059
|
+
return emitMock(recorded, "recorded");
|
|
3050
3060
|
}
|
|
3051
3061
|
}
|
|
3052
3062
|
const recordSpan = (result) => {
|
|
@@ -3346,7 +3356,9 @@ var Bitfab = class {
|
|
|
3346
3356
|
traceFunctionKey: params.traceFunctionKey,
|
|
3347
3357
|
rawSpan: externalSpan,
|
|
3348
3358
|
...params.testRunId && { testRunId: params.testRunId },
|
|
3349
|
-
...params.mocked && { mocked: true }
|
|
3359
|
+
...params.mocked && { mocked: true },
|
|
3360
|
+
...params.mockTarget && { mockTarget: params.mockTarget },
|
|
3361
|
+
...params.mockSource && { mockSource: params.mockSource }
|
|
3350
3362
|
});
|
|
3351
3363
|
}
|
|
3352
3364
|
registerMockOverride(overrideOrMatch, value) {
|
|
@@ -3371,7 +3383,7 @@ var Bitfab = class {
|
|
|
3371
3383
|
`Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
|
|
3372
3384
|
);
|
|
3373
3385
|
}
|
|
3374
|
-
const { replay: doReplay } = await import("./replay-
|
|
3386
|
+
const { replay: doReplay } = await import("./replay-P35CUNGH.js");
|
|
3375
3387
|
return doReplay(
|
|
3376
3388
|
this.httpClient,
|
|
3377
3389
|
this.serviceUrl,
|
|
@@ -3609,4 +3621,4 @@ export {
|
|
|
3609
3621
|
BitfabFunction,
|
|
3610
3622
|
finalizers
|
|
3611
3623
|
};
|
|
3612
|
-
//# sourceMappingURL=chunk-
|
|
3624
|
+
//# sourceMappingURL=chunk-OCJSHTJR.js.map
|