@antdv-next/x-sdk 0.0.3 → 0.0.4
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/chat-providers/types/model.d.ts +1 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +76 -0
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/expect → @vitest_expect@4.1.10/node_modules/@vitest/expect/dist}/index.js +53 -39
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/pretty-format → @vitest_pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist}/index.js +7 -6
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner → @vitest_runner@4.1.10/node_modules/@vitest/runner/dist}/chunk-artifact.js +14 -7
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/utils.js +2 -0
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/snapshot → @vitest_snapshot@4.1.10/node_modules/@vitest/snapshot/dist}/index.js +451 -192
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/spy → @vitest_spy@4.1.10/node_modules/@vitest/spy/dist}/index.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/chunk-pathe.M-eThtNZ.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/diff.js +39 -29
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/display.js +2 -2
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/error.js +34 -0
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/helpers.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/offset.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/serialize.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/source-map.js +2 -2
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils → @vitest_utils@4.1.10/node_modules/@vitest/utils/dist}/timers.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/vendor/chai.js → chai@6.2.2/node_modules/chai/index.js} +102 -2
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/vendor/magic-string.js → magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js} +3 -75
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.1/node_modules/tinyrainbow/dist/index.js +84 -0
- package/dist/node_modules/.pnpm/vitest@4.1.10_@types_node@24.12.0_@vitest_browser-preview@4.1.10_@vitest_coverage-v8@4._55bf307888d746e7433721e12ae091d9/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +4 -0
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test → vitest@4.1.10_@types_node@24.12.0_@vitest_browser-preview@4.1.10_@vitest_coverage-v8@4._55bf307888d746e7433721e12ae091d9/node_modules/vitest}/dist/chunks/rpc.MzXet3jl.js +1 -1
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/chunks/test.CBQUpOM3.js → vitest@4.1.10_@types_node@24.12.0_@vitest_browser-preview@4.1.10_@vitest_coverage-v8@4._55bf307888d746e7433721e12ae091d9/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js} +369 -318
- package/dist/node_modules/.pnpm/{@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test → vitest@4.1.10_@types_node@24.12.0_@vitest_browser-preview@4.1.10_@vitest_coverage-v8@4._55bf307888d746e7433721e12ae091d9/node_modules/vitest}/dist/chunks/utils.BX5Fg8C4.js +2 -2
- package/dist/x-chat/__tests__/index.test.js +2 -2
- package/dist/x-conversations/__tests__/index.test.js +2 -2
- package/dist/x-request/__tests__/index.test.js +2 -2
- package/dist/x-stream/__tests__/index.test.js +2 -2
- package/package.json +1 -1
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/error.js +0 -27
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -4
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/vendor/tinyrainbow.js +0 -84
|
@@ -82,7 +82,7 @@ export interface XModelResponse {
|
|
|
82
82
|
}[];
|
|
83
83
|
};
|
|
84
84
|
logprobs: AnyObject | null;
|
|
85
|
-
finish_reason: "stop" | "length" | "content_filter" | "tool_calls" | string;
|
|
85
|
+
finish_reason: "stop" | "length" | "content_filter" | "tool_calls" | (string & {});
|
|
86
86
|
}[];
|
|
87
87
|
created: number;
|
|
88
88
|
id: string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
2
|
+
var comma = ",".charCodeAt(0);
|
|
3
|
+
var semicolon = ";".charCodeAt(0);
|
|
4
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
6
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
7
|
+
for (let i = 0; i < chars.length; i++) {
|
|
8
|
+
const c = chars.charCodeAt(i);
|
|
9
|
+
intToChar[i] = c;
|
|
10
|
+
charToInt[c] = i;
|
|
11
|
+
}
|
|
12
|
+
function encodeInteger(builder, num, relative) {
|
|
13
|
+
let delta = num - relative;
|
|
14
|
+
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
15
|
+
do {
|
|
16
|
+
let clamped = delta & 31;
|
|
17
|
+
delta >>>= 5;
|
|
18
|
+
if (delta > 0) clamped |= 32;
|
|
19
|
+
builder.write(intToChar[clamped]);
|
|
20
|
+
} while (delta > 0);
|
|
21
|
+
return num;
|
|
22
|
+
}
|
|
23
|
+
var bufLength = 1024 * 16;
|
|
24
|
+
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
|
|
25
|
+
return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
|
|
26
|
+
} } : { decode(buf) {
|
|
27
|
+
let out = "";
|
|
28
|
+
for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
|
|
29
|
+
return out;
|
|
30
|
+
} };
|
|
31
|
+
var StringWriter = class {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.pos = 0;
|
|
34
|
+
this.out = "";
|
|
35
|
+
this.buffer = new Uint8Array(bufLength);
|
|
36
|
+
}
|
|
37
|
+
write(v) {
|
|
38
|
+
const { buffer } = this;
|
|
39
|
+
buffer[this.pos++] = v;
|
|
40
|
+
if (this.pos === bufLength) {
|
|
41
|
+
this.out += td.decode(buffer);
|
|
42
|
+
this.pos = 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
flush() {
|
|
46
|
+
const { buffer, out, pos } = this;
|
|
47
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function encode(decoded) {
|
|
51
|
+
const writer = new StringWriter();
|
|
52
|
+
let sourcesIndex = 0;
|
|
53
|
+
let sourceLine = 0;
|
|
54
|
+
let sourceColumn = 0;
|
|
55
|
+
let namesIndex = 0;
|
|
56
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
57
|
+
const line = decoded[i];
|
|
58
|
+
if (i > 0) writer.write(semicolon);
|
|
59
|
+
if (line.length === 0) continue;
|
|
60
|
+
let genColumn = 0;
|
|
61
|
+
for (let j = 0; j < line.length; j++) {
|
|
62
|
+
const segment = line[j];
|
|
63
|
+
if (j > 0) writer.write(comma);
|
|
64
|
+
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
65
|
+
if (segment.length === 1) continue;
|
|
66
|
+
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
67
|
+
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
68
|
+
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
69
|
+
if (segment.length === 4) continue;
|
|
70
|
+
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return writer.flush();
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { encode };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { stringify } from "
|
|
3
|
-
import { assertTypes, getType, isObject, noop, ordinal } from "
|
|
4
|
-
import { diff, printDiffOrStringify } from "
|
|
5
|
-
import { processError } from "
|
|
6
|
-
import { isMockFunction } from "
|
|
7
|
-
import { use, util as utils_exports } from "
|
|
8
|
-
//#region ../../node_modules/.pnpm/@
|
|
1
|
+
import y from "../../../../../tinyrainbow@3.1.1/node_modules/tinyrainbow/dist/index.js";
|
|
2
|
+
import { stringify } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/display.js";
|
|
3
|
+
import { assertTypes, getType, isObject, noop, ordinal } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/helpers.js";
|
|
4
|
+
import { diff, printDiffOrStringify } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/diff.js";
|
|
5
|
+
import { processError } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/error.js";
|
|
6
|
+
import { isMockFunction } from "../../../../../@vitest_spy@4.1.10/node_modules/@vitest/spy/dist/index.js";
|
|
7
|
+
import { use, util as utils_exports } from "../../../../../chai@6.2.2/node_modules/chai/index.js";
|
|
8
|
+
//#region ../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/dist/index.js
|
|
9
9
|
var ChaiStyleAssertions = (chai, utils) => {
|
|
10
10
|
function defProperty(name, delegateTo) {
|
|
11
11
|
utils.addProperty(chai.Assertion.prototype, name, function() {
|
|
@@ -97,11 +97,11 @@ ${printReceived(actual)}`
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
var EXPECTED_COLOR =
|
|
101
|
-
var RECEIVED_COLOR =
|
|
102
|
-
var INVERTED_COLOR =
|
|
103
|
-
var BOLD_WEIGHT =
|
|
104
|
-
var DIM_COLOR =
|
|
100
|
+
var EXPECTED_COLOR = y.green;
|
|
101
|
+
var RECEIVED_COLOR = y.red;
|
|
102
|
+
var INVERTED_COLOR = y.inverse;
|
|
103
|
+
var BOLD_WEIGHT = y.bold;
|
|
104
|
+
var DIM_COLOR = y.dim;
|
|
105
105
|
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
|
|
106
106
|
const { comment = "", isDirectExpectCall = false, isNot = false, promise = "", secondArgument = "", expectedColor = EXPECTED_COLOR, receivedColor = RECEIVED_COLOR, secondArgumentColor = EXPECTED_COLOR } = options;
|
|
107
107
|
let hint = "";
|
|
@@ -799,6 +799,7 @@ function handleTestError(test, err) {
|
|
|
799
799
|
test.result.errors ||= [];
|
|
800
800
|
test.result.errors.push(processError(err));
|
|
801
801
|
}
|
|
802
|
+
/** wrap assertion function to support `expect.soft` and provide assertion name as `_name` */
|
|
802
803
|
function wrapAssertion(utils, name, fn) {
|
|
803
804
|
return function(...args) {
|
|
804
805
|
if (name !== "withTest") utils.flag(this, "_name", name);
|
|
@@ -1341,25 +1342,25 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1341
1342
|
});
|
|
1342
1343
|
};
|
|
1343
1344
|
function formatCalls(spy, msg, showActualCall) {
|
|
1344
|
-
if (spy.mock.calls.length) msg +=
|
|
1345
|
-
let methodCall =
|
|
1345
|
+
if (spy.mock.calls.length) msg += y.gray(`\n\nReceived:\n\n${spy.mock.calls.map((callArg, i) => {
|
|
1346
|
+
let methodCall = y.bold(` ${ordinal(i + 1)} ${spy.getMockName()} call:\n\n`);
|
|
1346
1347
|
if (showActualCall) methodCall += diff(showActualCall, callArg, { omitAnnotationLines: true });
|
|
1347
1348
|
else methodCall += stringify(callArg).split("\n").map((line) => ` ${line}`).join("\n");
|
|
1348
1349
|
methodCall += "\n";
|
|
1349
1350
|
return methodCall;
|
|
1350
1351
|
}).join("\n")}`);
|
|
1351
|
-
msg +=
|
|
1352
|
+
msg += y.gray(`\n\nNumber of calls: ${y.bold(spy.mock.calls.length)}\n`);
|
|
1352
1353
|
return msg;
|
|
1353
1354
|
}
|
|
1354
1355
|
function formatReturns(spy, results, msg, showActualReturn) {
|
|
1355
|
-
if (results.length) msg +=
|
|
1356
|
-
let methodCall =
|
|
1356
|
+
if (results.length) msg += y.gray(`\n\nReceived:\n\n${results.map((callReturn, i) => {
|
|
1357
|
+
let methodCall = y.bold(` ${ordinal(i + 1)} ${spy.getMockName()} call return:\n\n`);
|
|
1357
1358
|
if (showActualReturn) methodCall += diff(showActualReturn, callReturn.value, { omitAnnotationLines: true });
|
|
1358
1359
|
else methodCall += stringify(callReturn).split("\n").map((line) => ` ${line}`).join("\n");
|
|
1359
1360
|
methodCall += "\n";
|
|
1360
1361
|
return methodCall;
|
|
1361
1362
|
}).join("\n")}`);
|
|
1362
|
-
msg +=
|
|
1363
|
+
msg += y.gray(`\n\nNumber of calls: ${y.bold(spy.mock.calls.length)}\n`);
|
|
1363
1364
|
return msg;
|
|
1364
1365
|
}
|
|
1365
1366
|
function getMatcherState(assertion, expect) {
|
|
@@ -1377,47 +1378,60 @@ function getMatcherState(assertion, expect) {
|
|
|
1377
1378
|
let task = utils_exports.flag(assertion, "vitest-test");
|
|
1378
1379
|
const currentTestName = task?.fullTestName ?? "";
|
|
1379
1380
|
if (task?.type !== "test") task = void 0;
|
|
1381
|
+
const matcherState = {
|
|
1382
|
+
...getState(expect),
|
|
1383
|
+
currentTestName,
|
|
1384
|
+
customTesters: getCustomEqualityTesters(),
|
|
1385
|
+
isNot,
|
|
1386
|
+
utils: jestUtils,
|
|
1387
|
+
promise,
|
|
1388
|
+
equals,
|
|
1389
|
+
suppressedErrors: [],
|
|
1390
|
+
soft: utils_exports.flag(assertion, "soft"),
|
|
1391
|
+
poll: utils_exports.flag(assertion, "poll"),
|
|
1392
|
+
assertion
|
|
1393
|
+
};
|
|
1394
|
+
Object.assign(matcherState, { task });
|
|
1380
1395
|
return {
|
|
1381
|
-
state:
|
|
1382
|
-
...getState(expect),
|
|
1383
|
-
task,
|
|
1384
|
-
currentTestName,
|
|
1385
|
-
customTesters: getCustomEqualityTesters(),
|
|
1386
|
-
isNot,
|
|
1387
|
-
utils: jestUtils,
|
|
1388
|
-
promise,
|
|
1389
|
-
equals,
|
|
1390
|
-
suppressedErrors: [],
|
|
1391
|
-
soft: utils_exports.flag(assertion, "soft"),
|
|
1392
|
-
poll: utils_exports.flag(assertion, "poll")
|
|
1393
|
-
},
|
|
1396
|
+
state: matcherState,
|
|
1394
1397
|
isNot,
|
|
1395
1398
|
obj,
|
|
1396
1399
|
customMessage
|
|
1397
1400
|
};
|
|
1398
1401
|
}
|
|
1399
1402
|
var JestExtendError = class extends Error {
|
|
1400
|
-
constructor(message, actual, expected) {
|
|
1403
|
+
constructor(message, actual, expected, __vitest_error_context__) {
|
|
1401
1404
|
super(message);
|
|
1402
1405
|
this.actual = actual;
|
|
1403
1406
|
this.expected = expected;
|
|
1407
|
+
this.__vitest_error_context__ = __vitest_error_context__;
|
|
1404
1408
|
}
|
|
1405
1409
|
};
|
|
1406
1410
|
function JestExtendPlugin(c, expect, matchers) {
|
|
1407
1411
|
return (_, utils) => {
|
|
1408
1412
|
Object.entries(matchers).forEach(([expectAssertionName, expectAssertion]) => {
|
|
1409
|
-
function
|
|
1413
|
+
function __VITEST_EXTEND_ASSERTION__(...args) {
|
|
1410
1414
|
const { state, isNot, obj, customMessage } = getMatcherState(this, expect);
|
|
1411
1415
|
const result = expectAssertion.call(state, obj, ...args);
|
|
1412
|
-
if (result && typeof result === "object" && typeof result.then === "function") return result.then(({ pass, message, actual, expected }) => {
|
|
1413
|
-
if (pass && isNot || !pass && !isNot) throw new JestExtendError(customMessage
|
|
1416
|
+
if (result && typeof result === "object" && typeof result.then === "function") return result.then(({ pass, message, actual, expected, meta }) => {
|
|
1417
|
+
if (pass && isNot || !pass && !isNot) throw new JestExtendError((customMessage ? `${customMessage}: ` : "") + message(), actual, expected, {
|
|
1418
|
+
assertionName: expectAssertionName,
|
|
1419
|
+
meta
|
|
1420
|
+
});
|
|
1421
|
+
});
|
|
1422
|
+
const { pass, message, actual, expected, meta } = result;
|
|
1423
|
+
if (pass && isNot || !pass && !isNot) throw new JestExtendError((customMessage ? `${customMessage}: ` : "") + message(), actual, expected, {
|
|
1424
|
+
assertionName: expectAssertionName,
|
|
1425
|
+
meta
|
|
1414
1426
|
});
|
|
1415
|
-
const { pass, message, actual, expected } = result;
|
|
1416
|
-
if (pass && isNot || !pass && !isNot) throw new JestExtendError(customMessage != null ? customMessage : message(), actual, expected);
|
|
1417
1427
|
}
|
|
1418
|
-
const softWrapper = wrapAssertion(utils, expectAssertionName,
|
|
1428
|
+
const softWrapper = wrapAssertion(utils, expectAssertionName, __VITEST_EXTEND_ASSERTION__);
|
|
1419
1429
|
utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, softWrapper);
|
|
1420
1430
|
utils.addMethod(c.Assertion.prototype, expectAssertionName, softWrapper);
|
|
1431
|
+
if (expectAssertion.__vitest_poll_takeover__) {
|
|
1432
|
+
const addedMethod = c.Assertion.prototype[expectAssertionName];
|
|
1433
|
+
Object.defineProperty(addedMethod, "__vitest_poll_takeover__", { value: true });
|
|
1434
|
+
}
|
|
1421
1435
|
class CustomMatcher extends AsymmetricMatcher {
|
|
1422
1436
|
constructor(inverse = false, ...sample) {
|
|
1423
1437
|
super(sample, inverse);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region ../../node_modules/.pnpm/@
|
|
1
|
+
import y from "../../../../../tinyrainbow@3.1.1/node_modules/tinyrainbow/dist/index.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.js
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function(e) {
|
|
5
5
|
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
@@ -770,8 +770,9 @@ function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
|
770
770
|
if (basicResult !== null) result = basicResult;
|
|
771
771
|
else result = printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
|
|
772
772
|
}
|
|
773
|
-
config.
|
|
774
|
-
|
|
773
|
+
config._outputLengthPerDepth[depth] ??= 0;
|
|
774
|
+
config._outputLengthPerDepth[depth] += result.length;
|
|
775
|
+
if (config._outputLengthPerDepth[depth] > config.maxOutputLength) config.maxDepth = 0;
|
|
775
776
|
return result;
|
|
776
777
|
}
|
|
777
778
|
var DEFAULT_THEME = {
|
|
@@ -806,7 +807,7 @@ function validateOptions(options) {
|
|
|
806
807
|
function getColorsHighlight() {
|
|
807
808
|
return DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
808
809
|
const value = DEFAULT_THEME[key];
|
|
809
|
-
const color = value &&
|
|
810
|
+
const color = value && y[value];
|
|
810
811
|
if (color && typeof color.close === "string" && typeof color.open === "string") colors[key] = color;
|
|
811
812
|
else throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
|
|
812
813
|
return colors;
|
|
@@ -848,7 +849,7 @@ function getConfig(options) {
|
|
|
848
849
|
spacingInner: options?.min ? " " : "\n",
|
|
849
850
|
spacingOuter: options?.min ? "" : "\n",
|
|
850
851
|
maxOutputLength: options?.maxOutputLength ?? DEFAULT_OPTIONS.maxOutputLength,
|
|
851
|
-
|
|
852
|
+
_outputLengthPerDepth: []
|
|
852
853
|
};
|
|
853
854
|
}
|
|
854
855
|
function createIndent(indent) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { format, formatRegExp, objDisplay } from "
|
|
2
|
-
import { assertTypes, createDefer, filterOutComments, isNegativeNaN, isObject, objectAttr, ordinal, toArray, unique } from "
|
|
3
|
-
import { getSafeTimers } from "
|
|
4
|
-
import { parseSingleStack } from "
|
|
5
|
-
//#region ../../node_modules/.pnpm/@
|
|
1
|
+
import { format, formatRegExp, objDisplay } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/display.js";
|
|
2
|
+
import { assertTypes, createDefer, filterOutComments, isNegativeNaN, isObject, objectAttr, ordinal, toArray, unique } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/helpers.js";
|
|
3
|
+
import { getSafeTimers } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/timers.js";
|
|
4
|
+
import { parseSingleStack } from "../../../../../@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/source-map.js";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/chunk-artifact.js
|
|
6
6
|
var PendingError = class extends Error {
|
|
7
7
|
code = "VITEST_PENDING";
|
|
8
8
|
taskId;
|
|
@@ -198,7 +198,7 @@ function withFixtures(fn, options) {
|
|
|
198
198
|
if (!registrations.size) return fn(context);
|
|
199
199
|
const usedFixtures = [];
|
|
200
200
|
const usedProps = getUsedProps(fn);
|
|
201
|
-
for (const fixture of registrations.values()) if (fixture
|
|
201
|
+
for (const fixture of registrations.values()) if (isAutoFixture(fixture, options) || usedProps.has(fixture.name)) usedFixtures.push(fixture);
|
|
202
202
|
if (!usedFixtures.length) return fn(context);
|
|
203
203
|
if (!cleanupFnArrayMap.has(context)) cleanupFnArrayMap.set(context, []);
|
|
204
204
|
const cleanupFnArray = cleanupFnArrayMap.get(context);
|
|
@@ -234,6 +234,11 @@ function withFixtures(fn, options) {
|
|
|
234
234
|
return fn(context);
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
+
function isAutoFixture(fixture, options) {
|
|
238
|
+
if (!fixture.auto) return false;
|
|
239
|
+
if (options?.suiteHook && fixture.scope === "test") return false;
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
237
242
|
function isFixtureFunction(value) {
|
|
238
243
|
return typeof value === "function";
|
|
239
244
|
}
|
|
@@ -875,7 +880,7 @@ function createSuiteCollector(name, factory = () => {}, mode, each, suiteOptions
|
|
|
875
880
|
};
|
|
876
881
|
const handler = options.handler;
|
|
877
882
|
if (task.mode === "run" && !handler) task.mode = "todo";
|
|
878
|
-
if (options.concurrent
|
|
883
|
+
if (options.concurrent ?? (!options.sequential && runner.config.sequence.concurrent)) task.concurrent = true;
|
|
879
884
|
task.shuffle = suiteOptions?.shuffle;
|
|
880
885
|
const context = createTestContext(task, runner);
|
|
881
886
|
Object.defineProperty(task, "context", {
|
|
@@ -1507,7 +1512,9 @@ function recordAsyncOperation(test, promise) {
|
|
|
1507
1512
|
function manageArtifactAttachment(attachment) {
|
|
1508
1513
|
if (attachment.body == null && !attachment.path) throw new TypeError(`Test attachment requires "body" or "path" to be set. Both are missing.`);
|
|
1509
1514
|
if (attachment.body && attachment.path) throw new TypeError(`Test attachment requires only one of "body" or "path" to be set. Both are specified.`);
|
|
1515
|
+
if (attachment.path && attachment.bodyEncoding) throw new TypeError(`Test attachment with "path" should not have "bodyEncoding" specified.`);
|
|
1510
1516
|
if (attachment.body instanceof Uint8Array) attachment.body = encodeUint8Array(attachment.body);
|
|
1517
|
+
if (attachment.body != null) attachment.bodyEncoding ??= "base64";
|
|
1511
1518
|
}
|
|
1512
1519
|
//#endregion
|
|
1513
1520
|
export { createTaskName as B, findTestFileStackTrace as C, getNames as G, validateTags as T, afterAll as a, afterEach as b, aroundAll as c, aroundEach as d, beforeAll as e, beforeEach as f, createTaskCollector as g, describe as h, getCurrentSuite as i, getCurrentTest as j, getHooks as l, it as m, setHooks as q, recordArtifact as r, setFn as s, suite as u, test as v, createChainable as y };
|