bitfab 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
package/dist/index.d.cts
CHANGED
|
@@ -2575,7 +2575,7 @@ declare class BitfabFunction {
|
|
|
2575
2575
|
/**
|
|
2576
2576
|
* SDK version from package.json (injected at build time)
|
|
2577
2577
|
*/
|
|
2578
|
-
declare const __version__ = "0.36.
|
|
2578
|
+
declare const __version__ = "0.36.12";
|
|
2579
2579
|
|
|
2580
2580
|
/**
|
|
2581
2581
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -2575,7 +2575,7 @@ declare class BitfabFunction {
|
|
|
2575
2575
|
/**
|
|
2576
2576
|
* SDK version from package.json (injected at build time)
|
|
2577
2577
|
*/
|
|
2578
|
-
declare const __version__ = "0.36.
|
|
2578
|
+
declare const __version__ = "0.36.12";
|
|
2579
2579
|
|
|
2580
2580
|
/**
|
|
2581
2581
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getCurrentReplayBranch,
|
|
21
21
|
getCurrentSpan,
|
|
22
22
|
getCurrentTrace
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OCJSHTJR.js";
|
|
24
24
|
import {
|
|
25
25
|
BITFAB_PROGRESS_PREFIX,
|
|
26
26
|
BitfabError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
flushTraces,
|
|
33
33
|
reportReplayProgress,
|
|
34
34
|
serializeReplayResult
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-VUYTATF5.js";
|
|
36
36
|
export {
|
|
37
37
|
BITFAB_PROGRESS_PREFIX,
|
|
38
38
|
Bitfab,
|
package/dist/node.cjs
CHANGED
|
@@ -97,7 +97,7 @@ var __version__;
|
|
|
97
97
|
var init_version_generated = __esm({
|
|
98
98
|
"src/version.generated.ts"() {
|
|
99
99
|
"use strict";
|
|
100
|
-
__version__ = "0.36.
|
|
100
|
+
__version__ = "0.36.12";
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
|
|
@@ -6124,14 +6124,19 @@ var Bitfab = class {
|
|
|
6124
6124
|
counters.set(counterKey, callIndex + 1);
|
|
6125
6125
|
const mockKey = `${counterKey}:${callIndex}`;
|
|
6126
6126
|
const mockSpan = replayCtxForMock.mockTree.spans.get(mockKey);
|
|
6127
|
-
const emitMock = (output) => {
|
|
6128
|
-
void sendSpan({
|
|
6127
|
+
const emitMock = (output, mockSource) => {
|
|
6128
|
+
void sendSpan({
|
|
6129
|
+
result: output,
|
|
6130
|
+
mocked: true,
|
|
6131
|
+
mockTarget: "output",
|
|
6132
|
+
mockSource
|
|
6133
|
+
});
|
|
6129
6134
|
if (fnReturnsPromise) {
|
|
6130
6135
|
return Promise.resolve(output);
|
|
6131
6136
|
}
|
|
6132
6137
|
return output;
|
|
6133
6138
|
};
|
|
6134
|
-
const emitMockAsync = (pending) => {
|
|
6139
|
+
const emitMockAsync = (pending, mockSource) => {
|
|
6135
6140
|
if (!fnReturnsPromise) {
|
|
6136
6141
|
throw new BitfabError(
|
|
6137
6142
|
`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.`
|
|
@@ -6139,7 +6144,12 @@ var Bitfab = class {
|
|
|
6139
6144
|
}
|
|
6140
6145
|
return (async () => {
|
|
6141
6146
|
const output = await pending;
|
|
6142
|
-
void sendSpan({
|
|
6147
|
+
void sendSpan({
|
|
6148
|
+
result: output,
|
|
6149
|
+
mocked: true,
|
|
6150
|
+
mockTarget: "output",
|
|
6151
|
+
mockSource
|
|
6152
|
+
});
|
|
6143
6153
|
return output;
|
|
6144
6154
|
})();
|
|
6145
6155
|
};
|
|
@@ -6181,18 +6191,18 @@ var Bitfab = class {
|
|
|
6181
6191
|
getOriginalOutput: () => Promise.resolve(resolveRecordedOutput())
|
|
6182
6192
|
});
|
|
6183
6193
|
if (injected instanceof Promise) {
|
|
6184
|
-
return emitMockAsync(injected);
|
|
6194
|
+
return emitMockAsync(injected, "override");
|
|
6185
6195
|
}
|
|
6186
|
-
return emitMock(injected);
|
|
6196
|
+
return emitMock(injected, "override");
|
|
6187
6197
|
}
|
|
6188
6198
|
}
|
|
6189
6199
|
const shouldMock = replayCtxForMock.mockStrategy === "all" || replayCtxForMock.mockStrategy === "marked" && options.mockOnReplay === true;
|
|
6190
6200
|
if (shouldMock && mockSpan) {
|
|
6191
6201
|
const recorded = resolveRecordedOutput();
|
|
6192
6202
|
if (recorded instanceof Promise) {
|
|
6193
|
-
return emitMockAsync(recorded);
|
|
6203
|
+
return emitMockAsync(recorded, "recorded");
|
|
6194
6204
|
}
|
|
6195
|
-
return emitMock(recorded);
|
|
6205
|
+
return emitMock(recorded, "recorded");
|
|
6196
6206
|
}
|
|
6197
6207
|
}
|
|
6198
6208
|
const recordSpan = (result) => {
|
|
@@ -6492,7 +6502,9 @@ var Bitfab = class {
|
|
|
6492
6502
|
traceFunctionKey: params.traceFunctionKey,
|
|
6493
6503
|
rawSpan: externalSpan,
|
|
6494
6504
|
...params.testRunId && { testRunId: params.testRunId },
|
|
6495
|
-
...params.mocked && { mocked: true }
|
|
6505
|
+
...params.mocked && { mocked: true },
|
|
6506
|
+
...params.mockTarget && { mockTarget: params.mockTarget },
|
|
6507
|
+
...params.mockSource && { mockSource: params.mockSource }
|
|
6496
6508
|
});
|
|
6497
6509
|
}
|
|
6498
6510
|
registerMockOverride(overrideOrMatch, value) {
|