@vitest/browser 0.20.2 → 0.21.1
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.
|
@@ -41,14 +41,16 @@ const p = function polyfill() {
|
|
|
41
41
|
};
|
|
42
42
|
p();
|
|
43
43
|
const scriptRel = "modulepreload";
|
|
44
|
+
const assetsURL = function(dep) {
|
|
45
|
+
return "/" + dep;
|
|
46
|
+
};
|
|
44
47
|
const seen = {};
|
|
45
|
-
const
|
|
46
|
-
const __vitePreload = function preload(baseModule, deps) {
|
|
48
|
+
const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
47
49
|
if (!deps || deps.length === 0) {
|
|
48
50
|
return baseModule();
|
|
49
51
|
}
|
|
50
52
|
return Promise.all(deps.map((dep) => {
|
|
51
|
-
dep =
|
|
53
|
+
dep = assetsURL(dep);
|
|
52
54
|
if (dep in seen)
|
|
53
55
|
return;
|
|
54
56
|
seen[dep] = true;
|
|
@@ -214,6 +216,11 @@ const stringify = (value, replacer, space) => {
|
|
|
214
216
|
return after;
|
|
215
217
|
}
|
|
216
218
|
};
|
|
219
|
+
const isAggregateError = (err) => {
|
|
220
|
+
if (typeof AggregateError !== "undefined" && err instanceof AggregateError)
|
|
221
|
+
return true;
|
|
222
|
+
return err instanceof Error && "errors" in err;
|
|
223
|
+
};
|
|
217
224
|
class StateManager {
|
|
218
225
|
constructor() {
|
|
219
226
|
this.filesMap = /* @__PURE__ */ new Map();
|
|
@@ -224,6 +231,8 @@ class StateManager {
|
|
|
224
231
|
this.errorsSet = /* @__PURE__ */ new Set();
|
|
225
232
|
}
|
|
226
233
|
catchError(err, type) {
|
|
234
|
+
if (isAggregateError(err))
|
|
235
|
+
return err.errors.forEach((error) => this.catchError(error, type));
|
|
227
236
|
err.type = type;
|
|
228
237
|
this.errorsSet.add(err);
|
|
229
238
|
}
|
package/dist/client/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/browser",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.1",
|
|
5
5
|
"description": "Browser running for Vitest",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"stubs"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"local-pkg": "^0.4.
|
|
28
|
-
"mlly": "^0.5.
|
|
29
|
-
"modern-node-polyfills": "^0.0.
|
|
27
|
+
"local-pkg": "^0.4.2",
|
|
28
|
+
"mlly": "^0.5.7",
|
|
29
|
+
"modern-node-polyfills": "^0.0.8",
|
|
30
30
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
31
31
|
"sirv": "^2.0.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/ws": "^8.
|
|
35
|
-
"@vitest/ws-client": "0.
|
|
34
|
+
"@types/ws": "^8.5.3",
|
|
35
|
+
"@vitest/ws-client": "0.21.1",
|
|
36
36
|
"picocolors": "^1.0.0",
|
|
37
|
-
"rollup": "^2.
|
|
38
|
-
"vitest": "0.
|
|
37
|
+
"rollup": "^2.77.2",
|
|
38
|
+
"vitest": "0.21.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rimraf dist && pnpm build:node && pnpm build:client && pnpm copy",
|