@antdv-next/x-sdk 0.0.2 → 0.0.3
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/LICENSE +21 -0
- package/dist/node_modules/{vitest → .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/index.js +26 -15
- package/dist/node_modules/{vitest → .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/index.js +6 -6
- package/dist/node_modules/{vitest → .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/chunk-artifact.js +5 -35
- package/dist/node_modules/{vitest → .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/index.js +5 -4
- package/dist/node_modules/{vitest → .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/index.js +3 -3
- package/dist/node_modules/{vitest → .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/chunk-pathe.M-eThtNZ.js +2 -2
- package/dist/node_modules/{vitest → .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/diff.js +3 -3
- package/dist/node_modules/{vitest → .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/display.js +2 -2
- package/dist/node_modules/{vitest → .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 +2 -2
- package/dist/node_modules/{vitest → .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/helpers.js +3 -3
- package/dist/node_modules/{vitest → .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/offset.js +1 -1
- package/dist/node_modules/{vitest → .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/serialize.js +1 -1
- package/dist/node_modules/{vitest → .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/source-map.js +5 -5
- package/dist/node_modules/{vitest → .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/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/chunks/_commonjsHelpers.D26ty3Ew.js +4 -0
- package/dist/node_modules/{vitest → .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/rpc.MzXet3jl.js +2 -2
- package/dist/node_modules/{vitest → .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 +17 -12
- package/dist/node_modules/{vitest → .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/utils.BX5Fg8C4.js +2 -2
- package/dist/node_modules/{vitest → .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 +2 -2
- package/dist/node_modules/{vitest → .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 +4 -4
- package/dist/node_modules/{vitest → .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 +2 -2
- package/dist/x-chat/__tests__/index.test.js +3 -2
- package/dist/x-chat/index.js +3 -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.d.ts +1 -0
- package/dist/x-stream/__tests__/index.test.js +62 -0
- package/dist/x-stream/index.js +16 -5
- package/package.json +2 -1
- package/dist/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Antdv Next
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import C from "../../vendor/tinyrainbow.js";
|
|
2
2
|
import { stringify } from "../utils/display.js";
|
|
3
3
|
import { assertTypes, getType, isObject, noop, ordinal } from "../utils/helpers.js";
|
|
4
4
|
import { diff, printDiffOrStringify } from "../utils/diff.js";
|
|
5
5
|
import { processError } from "../utils/error.js";
|
|
6
6
|
import { isMockFunction } from "../spy/index.js";
|
|
7
|
-
import { use, utils_exports } from "../../vendor/chai.js";
|
|
8
|
-
//#region ../../node_modules/
|
|
7
|
+
import { use, util as utils_exports } from "../../vendor/chai.js";
|
|
8
|
+
//#region ../../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/index.js
|
|
9
9
|
var ChaiStyleAssertions = (chai, utils) => {
|
|
10
10
|
function defProperty(name, delegateTo) {
|
|
11
11
|
utils.addProperty(chai.Assertion.prototype, name, function() {
|
|
@@ -843,8 +843,10 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
843
843
|
if (promise === "rejects") utils.flag(this, "object", () => {
|
|
844
844
|
throw object;
|
|
845
845
|
});
|
|
846
|
-
else if (promise === "resolves" && typeof object !== "function") if (!isNot)
|
|
847
|
-
|
|
846
|
+
else if (promise === "resolves" && typeof object !== "function") if (!isNot) {
|
|
847
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
848
|
+
throw new AssertionError(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
849
|
+
} else return;
|
|
848
850
|
_super.apply(this, args);
|
|
849
851
|
};
|
|
850
852
|
});
|
|
@@ -903,7 +905,8 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
903
905
|
actualSubset,
|
|
904
906
|
false
|
|
905
907
|
]);
|
|
906
|
-
|
|
908
|
+
const message = stripped === 0 ? msg : `${msg}\n(${stripped} matching ${stripped === 1 ? "property" : "properties"} omitted from actual)`;
|
|
909
|
+
throw new AssertionError(message, {
|
|
907
910
|
showDiff: true,
|
|
908
911
|
expected,
|
|
909
912
|
actual: actualSubset
|
|
@@ -1136,8 +1139,10 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1136
1139
|
const isNot = utils.flag(this, "negate");
|
|
1137
1140
|
let thrown = null;
|
|
1138
1141
|
if (promise === "rejects") thrown = obj;
|
|
1139
|
-
else if (promise === "resolves" && typeof obj !== "function") if (!isNot)
|
|
1140
|
-
|
|
1142
|
+
else if (promise === "resolves" && typeof obj !== "function") if (!isNot) {
|
|
1143
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
1144
|
+
throw new AssertionError(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
1145
|
+
} else return;
|
|
1141
1146
|
else {
|
|
1142
1147
|
let isThrow = false;
|
|
1143
1148
|
try {
|
|
@@ -1146,7 +1151,10 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1146
1151
|
isThrow = true;
|
|
1147
1152
|
thrown = err;
|
|
1148
1153
|
}
|
|
1149
|
-
if (!isThrow && !isNot)
|
|
1154
|
+
if (!isThrow && !isNot) {
|
|
1155
|
+
const message = utils.flag(this, "message") || "expected function to throw an error, but it didn't";
|
|
1156
|
+
throw new AssertionError(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
1157
|
+
}
|
|
1150
1158
|
}
|
|
1151
1159
|
if (typeof expected === "function") {
|
|
1152
1160
|
const name = expected.name || expected.prototype.constructor.name;
|
|
@@ -1216,7 +1224,8 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1216
1224
|
`expected "${spyName}" to not ${action} with: #{exp}`,
|
|
1217
1225
|
value
|
|
1218
1226
|
]);
|
|
1219
|
-
|
|
1227
|
+
const results = action === "return" ? spy.mock.results : spy.mock.settledResults;
|
|
1228
|
+
throw new AssertionError(formatReturns(spy, results, msg, value));
|
|
1220
1229
|
}
|
|
1221
1230
|
});
|
|
1222
1231
|
});
|
|
@@ -1282,7 +1291,7 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1282
1291
|
if (typeof result !== "function") return result instanceof chai.Assertion ? proxy : result;
|
|
1283
1292
|
return (...args) => {
|
|
1284
1293
|
utils.flag(this, "_name", key);
|
|
1285
|
-
|
|
1294
|
+
const promise = Promise.resolve(obj).then((value) => {
|
|
1286
1295
|
utils.flag(this, "object", value);
|
|
1287
1296
|
return result.call(this, ...args);
|
|
1288
1297
|
}, (err) => {
|
|
@@ -1292,7 +1301,8 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1292
1301
|
}).catch((err) => {
|
|
1293
1302
|
if (isError(err) && error.stack) err.stack = error.stack.replace(error.message, err.message);
|
|
1294
1303
|
throw err;
|
|
1295
|
-
})
|
|
1304
|
+
});
|
|
1305
|
+
return recordAsyncExpect(test, promise, createAssertionMessage(utils, this, !!args.length), error, utils.flag(this, "soft"));
|
|
1296
1306
|
};
|
|
1297
1307
|
} });
|
|
1298
1308
|
return proxy;
|
|
@@ -1311,7 +1321,7 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1311
1321
|
if (typeof result !== "function") return result instanceof chai.Assertion ? proxy : result;
|
|
1312
1322
|
return (...args) => {
|
|
1313
1323
|
utils.flag(this, "_name", key);
|
|
1314
|
-
|
|
1324
|
+
const promise = Promise.resolve(wrapper).then((value) => {
|
|
1315
1325
|
throw new AssertionError(`promise resolved "${utils.inspect(value)}" instead of rejecting`, {
|
|
1316
1326
|
showDiff: true,
|
|
1317
1327
|
expected: /* @__PURE__ */ new Error("rejected promise"),
|
|
@@ -1323,7 +1333,8 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
1323
1333
|
}).catch((err) => {
|
|
1324
1334
|
if (isError(err) && error.stack) err.stack = error.stack.replace(error.message, err.message);
|
|
1325
1335
|
throw err;
|
|
1326
|
-
})
|
|
1336
|
+
});
|
|
1337
|
+
return recordAsyncExpect(test, promise, createAssertionMessage(utils, this, !!args.length), error, utils.flag(this, "soft"));
|
|
1327
1338
|
};
|
|
1328
1339
|
} });
|
|
1329
1340
|
return proxy;
|
|
@@ -1453,4 +1464,4 @@ var JestExtend = (chai, utils) => {
|
|
|
1453
1464
|
});
|
|
1454
1465
|
};
|
|
1455
1466
|
//#endregion
|
|
1456
|
-
export { ASYMMETRIC_MATCHERS_OBJECT, ChaiStyleAssertions, GLOBAL_EXPECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, addCustomEqualityTesters, createAssertionMessage, customMatchers, equals, getState, iterableEquality, recordAsyncExpect, setState, subsetEquality, wrapAssertion };
|
|
1467
|
+
export { ASYMMETRIC_MATCHERS_OBJECT, Any, Anything, ArrayContaining, AsymmetricMatcher, ChaiStyleAssertions, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, ObjectContaining, SchemaMatching, StringContaining, StringMatching, addCustomEqualityTesters, arrayBufferEquality, createAssertionMessage, customMatchers, equals, generateToBeMessage, getObjectKeys, getObjectSubset, getState, isA, isAsymmetric, isError, isImmutableUnorderedKeyed, isImmutableUnorderedSet, isStandardSchema, iterableEquality, pluralize, recordAsyncExpect, setState, sparseArrayEquality, subsetEquality, typeEquality, wrapAssertion };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region ../../node_modules/
|
|
1
|
+
import C from "../../vendor/tinyrainbow.js";
|
|
2
|
+
//#region ../../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/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) {
|
|
@@ -153,7 +153,7 @@ var plugin$5 = {
|
|
|
153
153
|
test: test$5
|
|
154
154
|
};
|
|
155
155
|
var SPACE$1 = " ";
|
|
156
|
-
var OBJECT_NAMES = new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
156
|
+
var OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
157
157
|
var ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
|
|
158
158
|
function testName(name) {
|
|
159
159
|
return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
|
|
@@ -444,7 +444,7 @@ function requireReactIs$1() {
|
|
|
444
444
|
return reactIs$1.exports;
|
|
445
445
|
}
|
|
446
446
|
var reactIsExports$1 = requireReactIs$1();
|
|
447
|
-
var ReactIs19 =
|
|
447
|
+
var ReactIs19 = /*#__PURE__*/ _mergeNamespaces({
|
|
448
448
|
__proto__: null,
|
|
449
449
|
default: /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports$1)
|
|
450
450
|
}, [reactIsExports$1]);
|
|
@@ -556,7 +556,7 @@ function requireReactIs() {
|
|
|
556
556
|
return reactIs.exports;
|
|
557
557
|
}
|
|
558
558
|
var reactIsExports = requireReactIs();
|
|
559
|
-
var ReactIs18 =
|
|
559
|
+
var ReactIs18 = /*#__PURE__*/ _mergeNamespaces({
|
|
560
560
|
__proto__: null,
|
|
561
561
|
default: /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports)
|
|
562
562
|
}, [reactIsExports]);
|
|
@@ -881,4 +881,4 @@ var plugins = {
|
|
|
881
881
|
Error: ErrorPlugin
|
|
882
882
|
};
|
|
883
883
|
//#endregion
|
|
884
|
-
export { createDOMElementFilter, format, plugins };
|
|
884
|
+
export { DEFAULT_OPTIONS, createDOMElementFilter, format, plugins };
|
|
@@ -2,7 +2,7 @@ import { format, formatRegExp, objDisplay } from "../utils/display.js";
|
|
|
2
2
|
import { assertTypes, createDefer, filterOutComments, isNegativeNaN, isObject, objectAttr, ordinal, toArray, unique } from "../utils/helpers.js";
|
|
3
3
|
import { getSafeTimers } from "../utils/timers.js";
|
|
4
4
|
import { parseSingleStack } from "../utils/source-map.js";
|
|
5
|
-
//#region ../../node_modules/
|
|
5
|
+
//#region ../../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/chunk-artifact.js
|
|
6
6
|
var PendingError = class extends Error {
|
|
7
7
|
code = "VITEST_PENDING";
|
|
8
8
|
taskId;
|
|
@@ -85,7 +85,8 @@ var TestFixtures = class TestFixtures {
|
|
|
85
85
|
extend(runner, userFixtures) {
|
|
86
86
|
const { suite } = getCurrentSuite();
|
|
87
87
|
const isTopLevel = !suite || suite.file === suite;
|
|
88
|
-
|
|
88
|
+
const registrations = this.parseUserFixtures(runner, userFixtures, isTopLevel);
|
|
89
|
+
return new TestFixtures(registrations);
|
|
89
90
|
}
|
|
90
91
|
get(suite) {
|
|
91
92
|
let currentSuite = suite;
|
|
@@ -524,14 +525,6 @@ function afterEach(fn, timeout) {
|
|
|
524
525
|
};
|
|
525
526
|
return getCurrentSuite().on("afterEach", withTimeout(wrapper, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
526
527
|
}
|
|
527
|
-
createTestHook("onTestFailed", (test, handler, timeout) => {
|
|
528
|
-
test.onFailed ||= [];
|
|
529
|
-
test.onFailed.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
530
|
-
});
|
|
531
|
-
createTestHook("onTestFinished", (test, handler, timeout) => {
|
|
532
|
-
test.onFinished ||= [];
|
|
533
|
-
test.onFinished.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
534
|
-
});
|
|
535
528
|
/**
|
|
536
529
|
* Registers a callback function that wraps around all tests within the current suite.
|
|
537
530
|
* The callback receives a `runSuite` function that must be called to run the suite's tests.
|
|
@@ -631,14 +624,6 @@ function withSuiteFixtures(suiteHook, fn, context, stackTraceError, contextIndex
|
|
|
631
624
|
})();
|
|
632
625
|
};
|
|
633
626
|
}
|
|
634
|
-
function createTestHook(name, handler) {
|
|
635
|
-
return (fn, timeout) => {
|
|
636
|
-
assertTypes(fn, `"${name}" callback`, ["function"]);
|
|
637
|
-
const current = getCurrentTest();
|
|
638
|
-
if (!current) throw new Error(`Hook ${name}() can only be called inside a test`);
|
|
639
|
-
return handler(current, fn, timeout);
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
627
|
function findTestFileStackTrace(testFilePath, error) {
|
|
643
628
|
const lines = error.split("\n").slice(1);
|
|
644
629
|
for (const line of lines) {
|
|
@@ -1378,7 +1363,7 @@ function makeTimeoutError(isHook, timeout, stackTraceError) {
|
|
|
1378
1363
|
}
|
|
1379
1364
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
1380
1365
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
1381
|
-
|
|
1366
|
+
Date.now;
|
|
1382
1367
|
var { clearTimeout, setTimeout } = getSafeTimers();
|
|
1383
1368
|
var packs = /* @__PURE__ */ new Map();
|
|
1384
1369
|
var eventsPacks = [];
|
|
@@ -1405,21 +1390,6 @@ async function finishSendTasksUpdate(runner) {
|
|
|
1405
1390
|
sendTasksUpdate(runner);
|
|
1406
1391
|
await Promise.all(pendingTasksUpdates);
|
|
1407
1392
|
}
|
|
1408
|
-
function throttle(fn, ms) {
|
|
1409
|
-
let last = 0;
|
|
1410
|
-
let pendingCall;
|
|
1411
|
-
return function call(...args) {
|
|
1412
|
-
const now = unixNow();
|
|
1413
|
-
if (now - last > ms) {
|
|
1414
|
-
last = now;
|
|
1415
|
-
clearTimeout(pendingCall);
|
|
1416
|
-
pendingCall = void 0;
|
|
1417
|
-
return fn.apply(this, args);
|
|
1418
|
-
}
|
|
1419
|
-
pendingCall ??= setTimeout(() => call.bind(this)(...args), ms);
|
|
1420
|
-
};
|
|
1421
|
-
}
|
|
1422
|
-
throttle(sendTasksUpdate, 100);
|
|
1423
1393
|
/**
|
|
1424
1394
|
* @experimental
|
|
1425
1395
|
* @advanced
|
|
@@ -1540,4 +1510,4 @@ function manageArtifactAttachment(attachment) {
|
|
|
1540
1510
|
if (attachment.body instanceof Uint8Array) attachment.body = encodeUint8Array(attachment.body);
|
|
1541
1511
|
}
|
|
1542
1512
|
//#endregion
|
|
1543
|
-
export { describe, getCurrentTest,
|
|
1513
|
+
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 };
|
|
@@ -2,7 +2,7 @@ import { format, plugins } from "../pretty-format/index.js";
|
|
|
2
2
|
import { getCallLastIndex, isObject } from "../utils/helpers.js";
|
|
3
3
|
import { parseErrorStacktrace } from "../utils/source-map.js";
|
|
4
4
|
import { lineSplitRE, offsetToLineNumber, positionToOffset } from "../utils/offset.js";
|
|
5
|
-
//#region ../../node_modules/
|
|
5
|
+
//#region ../../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/index.js
|
|
6
6
|
async function saveInlineSnapshots(environment, snapshots) {
|
|
7
7
|
const MagicString = (await import("../../vendor/magic-string.js")).default;
|
|
8
8
|
const files = new Set(snapshots.map((i) => i.file));
|
|
@@ -153,7 +153,7 @@ function requireNaturalCompare() {
|
|
|
153
153
|
}
|
|
154
154
|
return naturalCompare$1.exports;
|
|
155
155
|
}
|
|
156
|
-
var naturalCompare =
|
|
156
|
+
var naturalCompare = /*@__PURE__*/ getDefaultExportFromCjs(requireNaturalCompare());
|
|
157
157
|
var serialize$1 = (val, config, indentation, depth, refs, printer) => {
|
|
158
158
|
const name = val.getMockName();
|
|
159
159
|
const nameString = name === "vi.fn()" ? "" : ` ${name}`;
|
|
@@ -373,7 +373,8 @@ var SnapshotState = class SnapshotState {
|
|
|
373
373
|
}
|
|
374
374
|
static async create(testFilePath, options) {
|
|
375
375
|
const snapshotPath = await options.snapshotEnvironment.resolvePath(testFilePath);
|
|
376
|
-
|
|
376
|
+
const content = await options.snapshotEnvironment.readSnapshotFile(snapshotPath);
|
|
377
|
+
return new SnapshotState(testFilePath, snapshotPath, content, options);
|
|
377
378
|
}
|
|
378
379
|
get environment() {
|
|
379
380
|
return this._environment;
|
|
@@ -657,4 +658,4 @@ var SnapshotClient = class {
|
|
|
657
658
|
}
|
|
658
659
|
};
|
|
659
660
|
//#endregion
|
|
660
|
-
export { SnapshotClient, addSerializer, stripSnapshotIndentation };
|
|
661
|
+
export { SnapshotClient, SnapshotState, addSerializer, getSerializers, stripSnapshotIndentation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/index.js
|
|
2
2
|
function isMockFunction(fn) {
|
|
3
3
|
return typeof fn === "function" && "_isMockFunction" in fn && fn._isMockFunction === true;
|
|
4
4
|
}
|
|
@@ -322,7 +322,7 @@ function copyOriginalStaticProperties(mock, original) {
|
|
|
322
322
|
Object.defineProperty(mock, key, descriptor);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
var ignoreProperties = new Set([
|
|
325
|
+
var ignoreProperties = /* @__PURE__ */ new Set([
|
|
326
326
|
"length",
|
|
327
327
|
"name",
|
|
328
328
|
"prototype",
|
|
@@ -381,4 +381,4 @@ function throwConstructorError(shorthand) {
|
|
|
381
381
|
throw new TypeError(`Cannot use \`${shorthand}\` when called with \`new\`. Use \`mockImplementation\` with a \`class\` keyword instead. See https://vitest.dev/api/mock#class-support for more information.`);
|
|
382
382
|
}
|
|
383
383
|
//#endregion
|
|
384
|
-
export { clearAllMocks, fn, isMockFunction, resetAllMocks, restoreAllMocks, spyOn };
|
|
384
|
+
export { clearAllMocks, createMockInstance, fn, isMockFunction, resetAllMocks, restoreAllMocks, spyOn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/chunk-pathe.M-eThtNZ.js
|
|
2
2
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
3
|
function normalizeWindowsPath(input = "") {
|
|
4
4
|
if (!input) return input;
|
|
@@ -77,4 +77,4 @@ var isAbsolute = function(p) {
|
|
|
77
77
|
return _IS_ABSOLUTE_RE.test(p);
|
|
78
78
|
};
|
|
79
79
|
//#endregion
|
|
80
|
-
export { resolve };
|
|
80
|
+
export { resolve as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import C from "../../vendor/tinyrainbow.js";
|
|
2
2
|
import { format, plugins } from "../pretty-format/index.js";
|
|
3
3
|
import { stringify } from "./display.js";
|
|
4
4
|
import { deepClone, getOwnProperties, getType as getType$1 } from "./helpers.js";
|
|
@@ -641,7 +641,7 @@ function requireBuild() {
|
|
|
641
641
|
}
|
|
642
642
|
return build;
|
|
643
643
|
}
|
|
644
|
-
var diffSequences =
|
|
644
|
+
var diffSequences = /*@__PURE__*/ getDefaultExportFromCjs(/* @__PURE__ */ requireBuild());
|
|
645
645
|
function formatTrailingSpaces(line, trailingSpaceFormatter) {
|
|
646
646
|
return line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
|
|
647
647
|
}
|
|
@@ -1301,4 +1301,4 @@ function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff) {
|
|
|
1301
1301
|
return diffs.reduce((reduced, diff) => reduced + (diff[0] === 0 ? diff[1] : diff[0] === op ? hasCommonDiff ? C.inverse(diff[1]) : diff[1] : ""), "");
|
|
1302
1302
|
}
|
|
1303
1303
|
//#endregion
|
|
1304
|
-
export { diff, printDiffOrStringify };
|
|
1304
|
+
export { Diff, diff, diffLinesRaw, diffLinesUnified, diffLinesUnified2, diffStringsRaw, diffStringsUnified, getLabelPrinter, printDiffOrStringify, replaceAsymmetricMatcher };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDOMElementFilter, format as format$1, plugins } from "../pretty-format/index.js";
|
|
2
|
-
//#region ../../node_modules/
|
|
2
|
+
//#region ../../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/display.js
|
|
3
3
|
var ansiColors = {
|
|
4
4
|
bold: ["1", "22"],
|
|
5
5
|
dim: ["2", "22"],
|
|
@@ -553,4 +553,4 @@ function objDisplay(obj, options = {}) {
|
|
|
553
553
|
return str;
|
|
554
554
|
}
|
|
555
555
|
//#endregion
|
|
556
|
-
export { format, formatRegExp, objDisplay, stringify };
|
|
556
|
+
export { format, formatRegExp, inspect, objDisplay, stringify };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { stringify } from "./display.js";
|
|
2
2
|
import { printDiffOrStringify } from "./diff.js";
|
|
3
3
|
import { serializeValue } from "./serialize.js";
|
|
4
|
-
//#region ../../node_modules/
|
|
4
|
+
//#region ../../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
|
|
5
5
|
function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
6
6
|
if (!_err || typeof _err !== "object") return { message: String(_err) };
|
|
7
7
|
const err = _err;
|
|
@@ -24,4 +24,4 @@ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
export { processError };
|
|
27
|
+
export { processError, serializeValue as serializeError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/helpers.js
|
|
2
2
|
/**
|
|
3
3
|
* Get original stacktrace without source map support the most performant way.
|
|
4
4
|
* - Create only 1 stack frame.
|
|
@@ -160,7 +160,7 @@ function getCallLastIndex(code) {
|
|
|
160
160
|
}
|
|
161
161
|
function isNegativeNaN(val) {
|
|
162
162
|
if (!Number.isNaN(val)) return false;
|
|
163
|
-
const f64 = new Float64Array(1);
|
|
163
|
+
const f64 = /* @__PURE__ */ new Float64Array(1);
|
|
164
164
|
f64[0] = val;
|
|
165
165
|
return new Uint32Array(f64.buffer)[1] >>> 31 === 1;
|
|
166
166
|
}
|
|
@@ -176,4 +176,4 @@ function unique(array) {
|
|
|
176
176
|
return Array.from(new Set(array));
|
|
177
177
|
}
|
|
178
178
|
//#endregion
|
|
179
|
-
export { assertTypes, createDefer, createSimpleStackTrace, deepClone, filterOutComments, getCallLastIndex, getOwnProperties, getType, isNegativeNaN, isObject, isPrimitive, noop, notNullish, objectAttr, ordinal, toArray, unique };
|
|
179
|
+
export { assertTypes, clone, createDefer, createSimpleStackTrace, deepClone, filterOutComments, getCallLastIndex, getOwnProperties, getType, isNegativeNaN, isObject, isPrimitive, noop, notNullish, objectAttr, ordinal, toArray, unique };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/offset.js
|
|
2
2
|
var lineSplitRE = /\r?\n/;
|
|
3
3
|
function positionToOffset(source, lineNumber, columnNumber) {
|
|
4
4
|
const lines = source.split(lineSplitRE);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/serialize.js
|
|
2
2
|
var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
3
3
|
var IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
4
4
|
function isImmutable(v) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isPrimitive, notNullish } from "./helpers.js";
|
|
2
|
-
import { resolve } from "./chunk-pathe.M-eThtNZ.js";
|
|
3
|
-
//#region ../../node_modules/
|
|
2
|
+
import { r as resolve } from "./chunk-pathe.M-eThtNZ.js";
|
|
3
|
+
//#region ../../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/source-map.js
|
|
4
4
|
var comma = ",".charCodeAt(0);
|
|
5
5
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
|
-
var intToChar = new Uint8Array(64);
|
|
7
|
-
var charToInt = new Uint8Array(128);
|
|
6
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
7
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
8
8
|
for (let i = 0; i < chars.length; i++) {
|
|
9
9
|
const c = chars.charCodeAt(i);
|
|
10
10
|
intToChar[i] = c;
|
|
@@ -368,4 +368,4 @@ function getOriginalPosition(map, needle) {
|
|
|
368
368
|
return result;
|
|
369
369
|
}
|
|
370
370
|
//#endregion
|
|
371
|
-
export { parseErrorStacktrace, parseSingleStack };
|
|
371
|
+
export { DecodedMap, stackIgnorePatterns as defaultStackIgnorePatterns, getOriginalPosition, parseErrorStacktrace, parseSingleFFOrSafariStack, parseSingleStack, parseSingleV8Stack, parseStacktrace };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/timers.js
|
|
2
2
|
var SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
|
|
3
3
|
function getSafeTimers() {
|
|
4
4
|
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../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
|
|
2
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
+
//#endregion
|
|
4
|
+
export { commonjsGlobal as c };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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/rpc.MzXet3jl.js
|
|
2
2
|
var RealDate = Date;
|
|
3
3
|
var now = null;
|
|
4
4
|
var MockDate = class MockDate extends RealDate {
|
|
@@ -47,4 +47,4 @@ function resetDate() {
|
|
|
47
47
|
}
|
|
48
48
|
var { get } = Reflect;
|
|
49
49
|
//#endregion
|
|
50
|
-
export { RealDate
|
|
50
|
+
export { RealDate as R, resetDate as b, mockDate as m };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { assertTypes, createSimpleStackTrace } from "../@vitest/utils/helpers.js";
|
|
2
2
|
import { delay, getSafeTimers } from "../@vitest/utils/timers.js";
|
|
3
3
|
import { parseSingleStack } from "../@vitest/utils/source-map.js";
|
|
4
|
-
import {
|
|
5
|
-
import { getWorkerState, isChildProcess, resetModules, waitForImportsToResolve } from "./utils.BX5Fg8C4.js";
|
|
4
|
+
import { G as getNames, j as getCurrentTest } from "../@vitest/runner/chunk-artifact.js";
|
|
5
|
+
import { g as getWorkerState, i as isChildProcess, r as resetModules, w as waitForImportsToResolve } from "./utils.BX5Fg8C4.js";
|
|
6
6
|
import { clearAllMocks, fn, isMockFunction, resetAllMocks, restoreAllMocks, spyOn } from "../@vitest/spy/index.js";
|
|
7
|
-
import { Assertion, assert as assert$1, expect, use, utils_exports } from "../vendor/chai.js";
|
|
7
|
+
import { Assertion, assert as assert$1, expect, use, util as utils_exports } from "../vendor/chai.js";
|
|
8
8
|
import { ASYMMETRIC_MATCHERS_OBJECT, ChaiStyleAssertions, GLOBAL_EXPECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, addCustomEqualityTesters, createAssertionMessage, customMatchers, equals, getState, iterableEquality, recordAsyncExpect, setState, subsetEquality, wrapAssertion } from "../@vitest/expect/index.js";
|
|
9
9
|
import { SnapshotClient, addSerializer, stripSnapshotIndentation } from "../@vitest/snapshot/index.js";
|
|
10
|
-
import { commonjsGlobal } from "./_commonjsHelpers.D26ty3Ew.js";
|
|
11
|
-
import { RealDate,
|
|
12
|
-
//#region ../../node_modules/
|
|
10
|
+
import { c as commonjsGlobal } from "./_commonjsHelpers.D26ty3Ew.js";
|
|
11
|
+
import { R as RealDate, b as resetDate, m as mockDate } from "./rpc.MzXet3jl.js";
|
|
12
|
+
//#region ../../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
|
|
13
13
|
var unsupported = [
|
|
14
14
|
"matchSnapshot",
|
|
15
15
|
"toMatchSnapshot",
|
|
@@ -1396,7 +1396,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
1396
1396
|
const originalPerfDescriptor = Object.getOwnPropertyDescriptor(target, method);
|
|
1397
1397
|
if (originalPerfDescriptor && originalPerfDescriptor.get && !originalPerfDescriptor.set) {
|
|
1398
1398
|
Object.defineProperty(clock, `_${method}`, originalPerfDescriptor);
|
|
1399
|
-
|
|
1399
|
+
const perfDescriptor = Object.getOwnPropertyDescriptor(clock, method);
|
|
1400
|
+
Object.defineProperty(target, method, perfDescriptor);
|
|
1400
1401
|
} else target[method] = clock[method];
|
|
1401
1402
|
} else {
|
|
1402
1403
|
target[method] = function() {
|
|
@@ -1831,7 +1832,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
1831
1832
|
clock.next();
|
|
1832
1833
|
checkIsNearInfiniteLimit(clock, i);
|
|
1833
1834
|
}
|
|
1834
|
-
|
|
1835
|
+
const excessJob = firstTimer(clock);
|
|
1836
|
+
throw getInfiniteLoopError(clock, excessJob);
|
|
1835
1837
|
};
|
|
1836
1838
|
clock.runToFrame = function runToFrame() {
|
|
1837
1839
|
return clock.tick(getTimeToNextFrame());
|
|
@@ -1865,7 +1867,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
1865
1867
|
checkIsNearInfiniteLimit(clock, i);
|
|
1866
1868
|
return;
|
|
1867
1869
|
}
|
|
1868
|
-
|
|
1870
|
+
const excessJob = firstTimer(clock);
|
|
1871
|
+
reject(getInfiniteLoopError(clock, excessJob));
|
|
1869
1872
|
} catch (e) {
|
|
1870
1873
|
reject(e);
|
|
1871
1874
|
}
|
|
@@ -1936,7 +1939,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
1936
1939
|
return clock;
|
|
1937
1940
|
}
|
|
1938
1941
|
function createIntervalTick(clock, delta) {
|
|
1939
|
-
|
|
1942
|
+
const intervalTick = doIntervalTick.bind(null, clock, delta);
|
|
1943
|
+
clock.attachedInterval = originalSetInterval(intervalTick, delta);
|
|
1940
1944
|
}
|
|
1941
1945
|
/**
|
|
1942
1946
|
* @param {Config=} [config] Optional config
|
|
@@ -2624,7 +2628,8 @@ function createVitest() {
|
|
|
2624
2628
|
};
|
|
2625
2629
|
return utils;
|
|
2626
2630
|
}
|
|
2627
|
-
var
|
|
2631
|
+
var vitest = createVitest();
|
|
2632
|
+
var vi = vitest;
|
|
2628
2633
|
function _mocker() {
|
|
2629
2634
|
return typeof __vitest_mocker__ !== "undefined" ? __vitest_mocker__ : new Proxy({}, { get(_, name) {
|
|
2630
2635
|
throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`);
|
|
@@ -2637,4 +2642,4 @@ function getImporter(name) {
|
|
|
2637
2642
|
}) + 1])?.file || "";
|
|
2638
2643
|
}
|
|
2639
2644
|
//#endregion
|
|
2640
|
-
export { globalExpect, vi };
|
|
2645
|
+
export { vitest as b, createExpect as c, globalExpect as g, vi as v };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSafeTimers } from "../@vitest/utils/timers.js";
|
|
2
|
-
//#region ../../node_modules/
|
|
2
|
+
//#region ../../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/utils.BX5Fg8C4.js
|
|
3
3
|
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
4
4
|
function getWorkerState() {
|
|
5
5
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -39,4 +39,4 @@ async function waitForImportsToResolve() {
|
|
|
39
39
|
await waitForImportsToResolve();
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
export { getWorkerState, isChildProcess, resetModules, waitForImportsToResolve };
|
|
42
|
+
export { getWorkerState as g, isChildProcess as i, resetModules as r, waitForImportsToResolve as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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.mjs
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
4
4
|
enumerable: true,
|
|
@@ -2869,4 +2869,4 @@ function use(fn) {
|
|
|
2869
2869
|
}
|
|
2870
2870
|
__name(use, "use");
|
|
2871
2871
|
//#endregion
|
|
2872
|
-
export { Assertion, assert, expect, should, use, utils_exports };
|
|
2872
|
+
export { Assertion, AssertionError, Should, assert, config, expect, should, use, utils_exports as util };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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.mjs
|
|
2
2
|
var comma = ",".charCodeAt(0);
|
|
3
3
|
var semicolon = ";".charCodeAt(0);
|
|
4
4
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5
|
-
var intToChar = new Uint8Array(64);
|
|
6
|
-
var charToInt = new Uint8Array(128);
|
|
5
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
6
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
7
7
|
for (let i = 0; i < chars.length; i++) {
|
|
8
8
|
const c = chars.charCodeAt(i);
|
|
9
9
|
intToChar[i] = c;
|
|
@@ -1006,4 +1006,4 @@ var MagicString = class MagicString {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
};
|
|
1008
1008
|
//#endregion
|
|
1009
|
-
export { MagicString as default };
|
|
1009
|
+
export { SourceMap, MagicString as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/
|
|
1
|
+
//#region ../../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.mjs
|
|
2
2
|
var d = {
|
|
3
3
|
reset: [0, 0],
|
|
4
4
|
bold: [
|
|
@@ -81,4 +81,4 @@ function f() {
|
|
|
81
81
|
}
|
|
82
82
|
var C = f();
|
|
83
83
|
//#endregion
|
|
84
|
-
export { C };
|
|
84
|
+
export { f as createColors, C as default, h as isSupported };
|
|
@@ -2,11 +2,12 @@ import AbstractChatProvider from "../../chat-providers/AbstractChatProvider.js";
|
|
|
2
2
|
import { AbstractXRequestClass } from "../../x-request/index.js";
|
|
3
3
|
import { chatMessagesStoreHelper } from "../store.js";
|
|
4
4
|
import useXChat from "../index.js";
|
|
5
|
-
import { describe, it } from "../../node_modules/
|
|
6
|
-
import { globalExpect, vi } from "../../node_modules/
|
|
5
|
+
import { h as describe, m as it } from "../../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/chunk-artifact.js";
|
|
6
|
+
import { g as globalExpect, v as vi } from "../../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";
|
|
7
7
|
import { computed, effectScope, nextTick, reactive, readonly, ref } from "vue";
|
|
8
8
|
//#region src/x-chat/__tests__/index.test.ts
|
|
9
9
|
var MockManualRequest = class extends AbstractXRequestClass {
|
|
10
|
+
shouldFail;
|
|
10
11
|
_asyncHandler = Promise.resolve();
|
|
11
12
|
_state = reactive({
|
|
12
13
|
isTimeout: false,
|
package/dist/x-chat/index.js
CHANGED
|
@@ -178,12 +178,13 @@ function useXChat(config) {
|
|
|
178
178
|
updatingMsgId = msg.id;
|
|
179
179
|
}
|
|
180
180
|
} else {
|
|
181
|
-
|
|
181
|
+
const transformData = activeProvider.transformMessage({
|
|
182
182
|
chunk,
|
|
183
183
|
status,
|
|
184
184
|
chunks,
|
|
185
185
|
responseHeaders
|
|
186
|
-
})
|
|
186
|
+
});
|
|
187
|
+
msg = createMessage(transformData, status);
|
|
187
188
|
requestStore.setMessages((ori) => {
|
|
188
189
|
return [...ori.filter((info) => info.id !== loadingMsgId), msg];
|
|
189
190
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import useXConversations from "../index.js";
|
|
2
|
-
import { describe, it } from "../../node_modules/
|
|
3
|
-
import { globalExpect } from "../../node_modules/
|
|
2
|
+
import { h as describe, m as it } from "../../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/chunk-artifact.js";
|
|
3
|
+
import { g as globalExpect } from "../../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";
|
|
4
4
|
import { effectScope, nextTick, ref } from "vue";
|
|
5
5
|
//#region src/x-conversations/__tests__/index.test.ts
|
|
6
6
|
describe("useXConversations", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XRequest from "../index.js";
|
|
2
|
-
import { describe, it } from "../../node_modules/
|
|
3
|
-
import { globalExpect, vi } from "../../node_modules/
|
|
2
|
+
import { h as describe, m as it } from "../../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/chunk-artifact.js";
|
|
3
|
+
import { g as globalExpect, v as vi } from "../../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";
|
|
4
4
|
import { ref } from "vue";
|
|
5
5
|
//#region src/x-request/__tests__/index.test.ts
|
|
6
6
|
describe("XRequest", () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import XStream from "../index.js";
|
|
2
|
+
import { h as describe, m as it } from "../../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/chunk-artifact.js";
|
|
3
|
+
import { g as globalExpect, v as vi } from "../../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";
|
|
4
|
+
//#region src/x-stream/__tests__/index.test.ts
|
|
5
|
+
var encoder = new TextEncoder();
|
|
6
|
+
describe("XStream", () => {
|
|
7
|
+
it("cancels the source and releases the reader lock on early exit", async () => {
|
|
8
|
+
const cancel = vi.fn();
|
|
9
|
+
const stream = XStream({ readableStream: new ReadableStream({
|
|
10
|
+
start(controller) {
|
|
11
|
+
controller.enqueue(encoder.encode("data: first\n\n"));
|
|
12
|
+
},
|
|
13
|
+
cancel
|
|
14
|
+
}) });
|
|
15
|
+
for await (const value of stream) {
|
|
16
|
+
globalExpect(value).toEqual({ data: "first" });
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
globalExpect(stream.locked).toBe(false);
|
|
20
|
+
await vi.waitFor(() => globalExpect(cancel).toHaveBeenCalledOnce());
|
|
21
|
+
const reader = stream.getReader();
|
|
22
|
+
await globalExpect(reader.read()).resolves.toEqual({
|
|
23
|
+
done: true,
|
|
24
|
+
value: void 0
|
|
25
|
+
});
|
|
26
|
+
reader.releaseLock();
|
|
27
|
+
});
|
|
28
|
+
it("preserves the consumer error when cancellation fails", async () => {
|
|
29
|
+
const consumerError = /* @__PURE__ */ new Error("consumer failed");
|
|
30
|
+
const cancelError = /* @__PURE__ */ new Error("cancel failed");
|
|
31
|
+
const cancel = vi.fn(() => Promise.reject(cancelError));
|
|
32
|
+
const stream = XStream({ readableStream: new ReadableStream({
|
|
33
|
+
start(controller) {
|
|
34
|
+
controller.enqueue(encoder.encode("data: first\n\n"));
|
|
35
|
+
},
|
|
36
|
+
cancel
|
|
37
|
+
}) });
|
|
38
|
+
const consume = async () => {
|
|
39
|
+
for await (const _value of stream) throw consumerError;
|
|
40
|
+
};
|
|
41
|
+
await globalExpect(consume()).rejects.toBe(consumerError);
|
|
42
|
+
globalExpect(cancel).toHaveBeenCalledOnce();
|
|
43
|
+
globalExpect(stream.locked).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
it("releases the reader lock without cancellation after normal completion", async () => {
|
|
46
|
+
const cancel = vi.fn();
|
|
47
|
+
const stream = XStream({ readableStream: new ReadableStream({
|
|
48
|
+
start(controller) {
|
|
49
|
+
controller.enqueue(encoder.encode("data: first\n\n"));
|
|
50
|
+
controller.enqueue(encoder.encode("data: second\n\n"));
|
|
51
|
+
controller.close();
|
|
52
|
+
},
|
|
53
|
+
cancel
|
|
54
|
+
}) });
|
|
55
|
+
const values = [];
|
|
56
|
+
for await (const value of stream) values.push(value);
|
|
57
|
+
globalExpect(values).toEqual([{ data: "first" }, { data: "second" }]);
|
|
58
|
+
globalExpect(cancel).not.toHaveBeenCalled();
|
|
59
|
+
globalExpect(stream.locked).toBe(false);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
package/dist/x-stream/index.js
CHANGED
|
@@ -101,11 +101,22 @@ function XStream(options) {
|
|
|
101
101
|
/** support async iterator */
|
|
102
102
|
stream[Symbol.asyncIterator] = async function* () {
|
|
103
103
|
const reader = this.getReader();
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
let completed = false;
|
|
105
|
+
try {
|
|
106
|
+
while (true) {
|
|
107
|
+
const { done, value } = await reader.read();
|
|
108
|
+
if (done) {
|
|
109
|
+
completed = true;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
if (!value) continue;
|
|
113
|
+
yield value;
|
|
114
|
+
}
|
|
115
|
+
} finally {
|
|
116
|
+
if (!completed) try {
|
|
117
|
+
await reader.cancel();
|
|
118
|
+
} catch {}
|
|
119
|
+
reader.releaseLock();
|
|
109
120
|
}
|
|
110
121
|
};
|
|
111
122
|
return stream;
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js
|
|
2
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
-
//#endregion
|
|
4
|
-
export { commonjsGlobal };
|