vitest 0.16.0 → 0.17.0
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-api-setup.f43cd039.mjs → chunk-api-setup.5282c6cb.mjs} +3 -3
- package/dist/{chunk-constants.7b9cfc82.mjs → chunk-constants.511c6e9b.mjs} +7 -1
- package/dist/chunk-env-node.dc514f41.mjs +670 -0
- package/dist/{chunk-integrations-globals.d0c363a6.mjs → chunk-integrations-globals.6bb781c7.mjs} +6 -6
- package/dist/{chunk-runtime-chain.7103058b.mjs → chunk-runtime-chain.68f305d0.mjs} +44 -132
- package/dist/{chunk-runtime-mocker.110e3634.mjs → chunk-runtime-mocker.1c207219.mjs} +28 -54
- package/dist/{chunk-utils-source-map.2556cba8.mjs → chunk-utils-source-map.f52527bc.mjs} +8 -22
- package/dist/{chunk-vite-node-externalize.58e10976.mjs → chunk-vite-node-externalize.1efbe319.mjs} +216 -199
- package/dist/{chunk-vite-node-utils.7450fc0c.mjs → chunk-vite-node-utils.4b58ae05.mjs} +13 -1
- package/dist/cli.mjs +9 -9
- package/dist/entry.mjs +6 -6
- package/dist/index.d.ts +130 -4
- package/dist/index.mjs +2 -2
- package/dist/node.d.ts +135 -16
- package/dist/node.mjs +11 -11
- package/dist/{vendor-entry.efeeaa5c.mjs → vendor-entry.2edaf3e0.mjs} +5 -418
- package/dist/worker.mjs +3 -3
- package/package.json +9 -4
- package/dist/chunk-defaults.dc6dc23d.mjs +0 -302
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
2
|
import { t as isNode, a as getWorkerState, h as safeClearTimeout, f as safeSetTimeout, C as toArray, N as deepClone, L as getType, q as relative, O as partitionSuiteChildren, P as hasTests, v as hasFailed, e as getFullName, r as resetModules } from './chunk-utils-global.79a8b1cc.mjs';
|
|
3
|
-
import {
|
|
4
|
-
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as globalExpect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, G as GLOBAL_EXPECT, z as getFn, A as getState } from './chunk-runtime-chain.
|
|
3
|
+
import { d as environments, t as takeCoverage, p as pLimit, f as envs } from './chunk-env-node.dc514f41.mjs';
|
|
4
|
+
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as globalExpect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, G as GLOBAL_EXPECT, z as getFn, A as getState } from './chunk-runtime-chain.68f305d0.mjs';
|
|
5
5
|
import chai, { assert, should, util } from 'chai';
|
|
6
6
|
import { r as rpc } from './chunk-runtime-rpc.5e78af38.mjs';
|
|
7
|
-
import { t as takeCoverage, p as pLimit } from './chunk-defaults.dc6dc23d.mjs';
|
|
8
7
|
import { format } from 'util';
|
|
9
|
-
import { s as stringify } from './chunk-utils-source-map.
|
|
8
|
+
import { s as stringify } from './chunk-utils-source-map.f52527bc.mjs';
|
|
10
9
|
|
|
11
10
|
var index = /*#__PURE__*/Object.freeze({
|
|
12
11
|
__proto__: null,
|
|
@@ -32,398 +31,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
32
31
|
isWatchMode: isWatchMode
|
|
33
32
|
});
|
|
34
33
|
|
|
35
|
-
var node = {
|
|
36
|
-
name: "node",
|
|
37
|
-
async setup() {
|
|
38
|
-
return {
|
|
39
|
-
teardown() {
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const LIVING_KEYS = [
|
|
46
|
-
"DOMException",
|
|
47
|
-
"URL",
|
|
48
|
-
"URLSearchParams",
|
|
49
|
-
"EventTarget",
|
|
50
|
-
"NamedNodeMap",
|
|
51
|
-
"Node",
|
|
52
|
-
"Attr",
|
|
53
|
-
"Element",
|
|
54
|
-
"DocumentFragment",
|
|
55
|
-
"DOMImplementation",
|
|
56
|
-
"Document",
|
|
57
|
-
"XMLDocument",
|
|
58
|
-
"CharacterData",
|
|
59
|
-
"Text",
|
|
60
|
-
"CDATASection",
|
|
61
|
-
"ProcessingInstruction",
|
|
62
|
-
"Comment",
|
|
63
|
-
"DocumentType",
|
|
64
|
-
"NodeList",
|
|
65
|
-
"HTMLCollection",
|
|
66
|
-
"HTMLOptionsCollection",
|
|
67
|
-
"DOMStringMap",
|
|
68
|
-
"DOMTokenList",
|
|
69
|
-
"StyleSheetList",
|
|
70
|
-
"HTMLElement",
|
|
71
|
-
"HTMLHeadElement",
|
|
72
|
-
"HTMLTitleElement",
|
|
73
|
-
"HTMLBaseElement",
|
|
74
|
-
"HTMLLinkElement",
|
|
75
|
-
"HTMLMetaElement",
|
|
76
|
-
"HTMLStyleElement",
|
|
77
|
-
"HTMLBodyElement",
|
|
78
|
-
"HTMLHeadingElement",
|
|
79
|
-
"HTMLParagraphElement",
|
|
80
|
-
"HTMLHRElement",
|
|
81
|
-
"HTMLPreElement",
|
|
82
|
-
"HTMLUListElement",
|
|
83
|
-
"HTMLOListElement",
|
|
84
|
-
"HTMLLIElement",
|
|
85
|
-
"HTMLMenuElement",
|
|
86
|
-
"HTMLDListElement",
|
|
87
|
-
"HTMLDivElement",
|
|
88
|
-
"HTMLAnchorElement",
|
|
89
|
-
"HTMLAreaElement",
|
|
90
|
-
"HTMLBRElement",
|
|
91
|
-
"HTMLButtonElement",
|
|
92
|
-
"HTMLCanvasElement",
|
|
93
|
-
"HTMLDataElement",
|
|
94
|
-
"HTMLDataListElement",
|
|
95
|
-
"HTMLDetailsElement",
|
|
96
|
-
"HTMLDialogElement",
|
|
97
|
-
"HTMLDirectoryElement",
|
|
98
|
-
"HTMLFieldSetElement",
|
|
99
|
-
"HTMLFontElement",
|
|
100
|
-
"HTMLFormElement",
|
|
101
|
-
"HTMLHtmlElement",
|
|
102
|
-
"HTMLImageElement",
|
|
103
|
-
"HTMLInputElement",
|
|
104
|
-
"HTMLLabelElement",
|
|
105
|
-
"HTMLLegendElement",
|
|
106
|
-
"HTMLMapElement",
|
|
107
|
-
"HTMLMarqueeElement",
|
|
108
|
-
"HTMLMediaElement",
|
|
109
|
-
"HTMLMeterElement",
|
|
110
|
-
"HTMLModElement",
|
|
111
|
-
"HTMLOptGroupElement",
|
|
112
|
-
"HTMLOptionElement",
|
|
113
|
-
"HTMLOutputElement",
|
|
114
|
-
"HTMLPictureElement",
|
|
115
|
-
"HTMLProgressElement",
|
|
116
|
-
"HTMLQuoteElement",
|
|
117
|
-
"HTMLScriptElement",
|
|
118
|
-
"HTMLSelectElement",
|
|
119
|
-
"HTMLSlotElement",
|
|
120
|
-
"HTMLSourceElement",
|
|
121
|
-
"HTMLSpanElement",
|
|
122
|
-
"HTMLTableCaptionElement",
|
|
123
|
-
"HTMLTableCellElement",
|
|
124
|
-
"HTMLTableColElement",
|
|
125
|
-
"HTMLTableElement",
|
|
126
|
-
"HTMLTimeElement",
|
|
127
|
-
"HTMLTableRowElement",
|
|
128
|
-
"HTMLTableSectionElement",
|
|
129
|
-
"HTMLTemplateElement",
|
|
130
|
-
"HTMLTextAreaElement",
|
|
131
|
-
"HTMLUnknownElement",
|
|
132
|
-
"HTMLFrameElement",
|
|
133
|
-
"HTMLFrameSetElement",
|
|
134
|
-
"HTMLIFrameElement",
|
|
135
|
-
"HTMLEmbedElement",
|
|
136
|
-
"HTMLObjectElement",
|
|
137
|
-
"HTMLParamElement",
|
|
138
|
-
"HTMLVideoElement",
|
|
139
|
-
"HTMLAudioElement",
|
|
140
|
-
"HTMLTrackElement",
|
|
141
|
-
"SVGElement",
|
|
142
|
-
"SVGGraphicsElement",
|
|
143
|
-
"SVGSVGElement",
|
|
144
|
-
"SVGTitleElement",
|
|
145
|
-
"SVGAnimatedString",
|
|
146
|
-
"SVGNumber",
|
|
147
|
-
"SVGStringList",
|
|
148
|
-
"Event",
|
|
149
|
-
"CloseEvent",
|
|
150
|
-
"CustomEvent",
|
|
151
|
-
"MessageEvent",
|
|
152
|
-
"ErrorEvent",
|
|
153
|
-
"HashChangeEvent",
|
|
154
|
-
"PopStateEvent",
|
|
155
|
-
"StorageEvent",
|
|
156
|
-
"ProgressEvent",
|
|
157
|
-
"PageTransitionEvent",
|
|
158
|
-
"UIEvent",
|
|
159
|
-
"FocusEvent",
|
|
160
|
-
"InputEvent",
|
|
161
|
-
"MouseEvent",
|
|
162
|
-
"KeyboardEvent",
|
|
163
|
-
"TouchEvent",
|
|
164
|
-
"CompositionEvent",
|
|
165
|
-
"WheelEvent",
|
|
166
|
-
"BarProp",
|
|
167
|
-
"External",
|
|
168
|
-
"Location",
|
|
169
|
-
"History",
|
|
170
|
-
"Screen",
|
|
171
|
-
"Performance",
|
|
172
|
-
"Navigator",
|
|
173
|
-
"PluginArray",
|
|
174
|
-
"MimeTypeArray",
|
|
175
|
-
"Plugin",
|
|
176
|
-
"MimeType",
|
|
177
|
-
"FileReader",
|
|
178
|
-
"Blob",
|
|
179
|
-
"File",
|
|
180
|
-
"FileList",
|
|
181
|
-
"ValidityState",
|
|
182
|
-
"DOMParser",
|
|
183
|
-
"XMLSerializer",
|
|
184
|
-
"FormData",
|
|
185
|
-
"XMLHttpRequestEventTarget",
|
|
186
|
-
"XMLHttpRequestUpload",
|
|
187
|
-
"XMLHttpRequest",
|
|
188
|
-
"WebSocket",
|
|
189
|
-
"NodeFilter",
|
|
190
|
-
"NodeIterator",
|
|
191
|
-
"TreeWalker",
|
|
192
|
-
"AbstractRange",
|
|
193
|
-
"Range",
|
|
194
|
-
"StaticRange",
|
|
195
|
-
"Selection",
|
|
196
|
-
"Storage",
|
|
197
|
-
"CustomElementRegistry",
|
|
198
|
-
"ShadowRoot",
|
|
199
|
-
"MutationObserver",
|
|
200
|
-
"MutationRecord",
|
|
201
|
-
"Headers",
|
|
202
|
-
"AbortController",
|
|
203
|
-
"AbortSignal",
|
|
204
|
-
"Image",
|
|
205
|
-
"Audio",
|
|
206
|
-
"Option"
|
|
207
|
-
];
|
|
208
|
-
const OTHER_KEYS = [
|
|
209
|
-
"addEventListener",
|
|
210
|
-
"alert",
|
|
211
|
-
"atob",
|
|
212
|
-
"blur",
|
|
213
|
-
"btoa",
|
|
214
|
-
"cancelAnimationFrame",
|
|
215
|
-
"close",
|
|
216
|
-
"confirm",
|
|
217
|
-
"createPopup",
|
|
218
|
-
"dispatchEvent",
|
|
219
|
-
"document",
|
|
220
|
-
"focus",
|
|
221
|
-
"frames",
|
|
222
|
-
"getComputedStyle",
|
|
223
|
-
"history",
|
|
224
|
-
"innerHeight",
|
|
225
|
-
"innerWidth",
|
|
226
|
-
"length",
|
|
227
|
-
"location",
|
|
228
|
-
"matchMedia",
|
|
229
|
-
"moveBy",
|
|
230
|
-
"moveTo",
|
|
231
|
-
"name",
|
|
232
|
-
"navigator",
|
|
233
|
-
"open",
|
|
234
|
-
"outerHeight",
|
|
235
|
-
"outerWidth",
|
|
236
|
-
"pageXOffset",
|
|
237
|
-
"pageYOffset",
|
|
238
|
-
"parent",
|
|
239
|
-
"postMessage",
|
|
240
|
-
"print",
|
|
241
|
-
"prompt",
|
|
242
|
-
"removeEventListener",
|
|
243
|
-
"requestAnimationFrame",
|
|
244
|
-
"resizeBy",
|
|
245
|
-
"resizeTo",
|
|
246
|
-
"screen",
|
|
247
|
-
"screenLeft",
|
|
248
|
-
"screenTop",
|
|
249
|
-
"screenX",
|
|
250
|
-
"screenY",
|
|
251
|
-
"scroll",
|
|
252
|
-
"scrollBy",
|
|
253
|
-
"scrollLeft",
|
|
254
|
-
"scrollTo",
|
|
255
|
-
"scrollTop",
|
|
256
|
-
"scrollX",
|
|
257
|
-
"scrollY",
|
|
258
|
-
"self",
|
|
259
|
-
"stop",
|
|
260
|
-
"top",
|
|
261
|
-
"Window",
|
|
262
|
-
"window"
|
|
263
|
-
];
|
|
264
|
-
const KEYS = LIVING_KEYS.concat(OTHER_KEYS);
|
|
265
|
-
|
|
266
|
-
const allowRewrite = [
|
|
267
|
-
"Event",
|
|
268
|
-
"EventTarget"
|
|
269
|
-
];
|
|
270
|
-
const skipKeys = [
|
|
271
|
-
"window",
|
|
272
|
-
"self",
|
|
273
|
-
"top",
|
|
274
|
-
"parent"
|
|
275
|
-
];
|
|
276
|
-
function getWindowKeys(global, win) {
|
|
277
|
-
const keys = new Set(KEYS.concat(Object.getOwnPropertyNames(win)).filter((k) => {
|
|
278
|
-
if (skipKeys.includes(k))
|
|
279
|
-
return false;
|
|
280
|
-
if (k in global)
|
|
281
|
-
return allowRewrite.includes(k);
|
|
282
|
-
return true;
|
|
283
|
-
}));
|
|
284
|
-
return keys;
|
|
285
|
-
}
|
|
286
|
-
function isClassLikeName(name) {
|
|
287
|
-
return name[0] === name[0].toUpperCase();
|
|
288
|
-
}
|
|
289
|
-
function populateGlobal(global, win, options = {}) {
|
|
290
|
-
const { bindFunctions = false } = options;
|
|
291
|
-
const keys = getWindowKeys(global, win);
|
|
292
|
-
const originals = new Map(allowRewrite.map(([key]) => [key, global[key]]));
|
|
293
|
-
const overrideObject = /* @__PURE__ */ new Map();
|
|
294
|
-
for (const key of keys) {
|
|
295
|
-
const boundFunction = bindFunctions && typeof win[key] === "function" && !isClassLikeName(key) && win[key].bind(win);
|
|
296
|
-
Object.defineProperty(global, key, {
|
|
297
|
-
get() {
|
|
298
|
-
if (overrideObject.has(key))
|
|
299
|
-
return overrideObject.get(key);
|
|
300
|
-
if (boundFunction)
|
|
301
|
-
return boundFunction;
|
|
302
|
-
return win[key];
|
|
303
|
-
},
|
|
304
|
-
set(v) {
|
|
305
|
-
overrideObject.set(key, v);
|
|
306
|
-
},
|
|
307
|
-
configurable: true
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
global.window = global;
|
|
311
|
-
global.self = global;
|
|
312
|
-
global.top = global;
|
|
313
|
-
global.parent = global;
|
|
314
|
-
if (global.global)
|
|
315
|
-
global.global = global;
|
|
316
|
-
skipKeys.forEach((k) => keys.add(k));
|
|
317
|
-
return {
|
|
318
|
-
keys,
|
|
319
|
-
skipKeys,
|
|
320
|
-
originals
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
var __defProp$1 = Object.defineProperty;
|
|
325
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
326
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
327
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
328
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
329
|
-
var __spreadValues$1 = (a, b) => {
|
|
330
|
-
for (var prop in b || (b = {}))
|
|
331
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
332
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
333
|
-
if (__getOwnPropSymbols$1)
|
|
334
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
335
|
-
if (__propIsEnum$1.call(b, prop))
|
|
336
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
337
|
-
}
|
|
338
|
-
return a;
|
|
339
|
-
};
|
|
340
|
-
var __objRest = (source, exclude) => {
|
|
341
|
-
var target = {};
|
|
342
|
-
for (var prop in source)
|
|
343
|
-
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
344
|
-
target[prop] = source[prop];
|
|
345
|
-
if (source != null && __getOwnPropSymbols$1)
|
|
346
|
-
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
347
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
348
|
-
target[prop] = source[prop];
|
|
349
|
-
}
|
|
350
|
-
return target;
|
|
351
|
-
};
|
|
352
|
-
var jsdom = {
|
|
353
|
-
name: "jsdom",
|
|
354
|
-
async setup(global, { jsdom = {} }) {
|
|
355
|
-
const {
|
|
356
|
-
CookieJar,
|
|
357
|
-
JSDOM,
|
|
358
|
-
ResourceLoader,
|
|
359
|
-
VirtualConsole
|
|
360
|
-
} = await importModule("jsdom");
|
|
361
|
-
const _a = jsdom, {
|
|
362
|
-
html = "<!DOCTYPE html>",
|
|
363
|
-
userAgent,
|
|
364
|
-
url = "http://localhost:3000",
|
|
365
|
-
contentType = "text/html",
|
|
366
|
-
pretendToBeVisual = true,
|
|
367
|
-
includeNodeLocations = false,
|
|
368
|
-
runScripts = "dangerously",
|
|
369
|
-
resources,
|
|
370
|
-
console = false,
|
|
371
|
-
cookieJar = false
|
|
372
|
-
} = _a, restOptions = __objRest(_a, [
|
|
373
|
-
"html",
|
|
374
|
-
"userAgent",
|
|
375
|
-
"url",
|
|
376
|
-
"contentType",
|
|
377
|
-
"pretendToBeVisual",
|
|
378
|
-
"includeNodeLocations",
|
|
379
|
-
"runScripts",
|
|
380
|
-
"resources",
|
|
381
|
-
"console",
|
|
382
|
-
"cookieJar"
|
|
383
|
-
]);
|
|
384
|
-
const dom = new JSDOM(html, __spreadValues$1({
|
|
385
|
-
pretendToBeVisual,
|
|
386
|
-
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
|
|
387
|
-
runScripts,
|
|
388
|
-
url,
|
|
389
|
-
virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : void 0,
|
|
390
|
-
cookieJar: cookieJar ? new CookieJar() : void 0,
|
|
391
|
-
includeNodeLocations,
|
|
392
|
-
contentType,
|
|
393
|
-
userAgent
|
|
394
|
-
}, restOptions));
|
|
395
|
-
const { keys, originals } = populateGlobal(global, dom.window, { bindFunctions: true });
|
|
396
|
-
return {
|
|
397
|
-
teardown(global2) {
|
|
398
|
-
keys.forEach((key) => delete global2[key]);
|
|
399
|
-
originals.forEach((v, k) => global2[k] = v);
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
var happy = {
|
|
406
|
-
name: "happy-dom",
|
|
407
|
-
async setup(global) {
|
|
408
|
-
const { Window, GlobalWindow } = await importModule("happy-dom");
|
|
409
|
-
const win = new (GlobalWindow || Window)();
|
|
410
|
-
const { keys, originals } = populateGlobal(global, win, { bindFunctions: true });
|
|
411
|
-
return {
|
|
412
|
-
teardown(global2) {
|
|
413
|
-
win.happyDOM.cancelAsync();
|
|
414
|
-
keys.forEach((key) => delete global2[key]);
|
|
415
|
-
originals.forEach((v, k) => global2[k] = v);
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
const environments = {
|
|
422
|
-
node,
|
|
423
|
-
jsdom,
|
|
424
|
-
"happy-dom": happy
|
|
425
|
-
};
|
|
426
|
-
|
|
427
34
|
let globalSetup = false;
|
|
428
35
|
async function setupGlobalEnv(config) {
|
|
429
36
|
resetRunOnceCounter();
|
|
@@ -438,7 +45,7 @@ async function setupGlobalEnv(config) {
|
|
|
438
45
|
if (isNode)
|
|
439
46
|
await setupConsoleLogSpy();
|
|
440
47
|
if (config.globals)
|
|
441
|
-
(await import('./chunk-integrations-globals.
|
|
48
|
+
(await import('./chunk-integrations-globals.6bb781c7.mjs')).registerApiGlobally();
|
|
442
49
|
}
|
|
443
50
|
function setupDefines(defines) {
|
|
444
51
|
for (const key in defines)
|
|
@@ -792,25 +399,6 @@ function calculateHash(parent) {
|
|
|
792
399
|
});
|
|
793
400
|
}
|
|
794
401
|
|
|
795
|
-
var __defProp = Object.defineProperty;
|
|
796
|
-
var __defProps = Object.defineProperties;
|
|
797
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
798
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
799
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
800
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
801
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
802
|
-
var __spreadValues = (a, b) => {
|
|
803
|
-
for (var prop in b || (b = {}))
|
|
804
|
-
if (__hasOwnProp.call(b, prop))
|
|
805
|
-
__defNormalProp(a, prop, b[prop]);
|
|
806
|
-
if (__getOwnPropSymbols)
|
|
807
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
808
|
-
if (__propIsEnum.call(b, prop))
|
|
809
|
-
__defNormalProp(a, prop, b[prop]);
|
|
810
|
-
}
|
|
811
|
-
return a;
|
|
812
|
-
};
|
|
813
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
814
402
|
const now = Date.now;
|
|
815
403
|
function updateSuiteHookState(suite, name, state) {
|
|
816
404
|
var _a;
|
|
@@ -931,7 +519,7 @@ async function runTest(test) {
|
|
|
931
519
|
function markTasksAsSkipped(suite) {
|
|
932
520
|
suite.tasks.forEach((t) => {
|
|
933
521
|
t.mode = "skip";
|
|
934
|
-
t.result =
|
|
522
|
+
t.result = { ...t.result, state: "skip" };
|
|
935
523
|
updateTask(t);
|
|
936
524
|
if (t.type === "suite")
|
|
937
525
|
markTasksAsSkipped(t);
|
|
@@ -1029,7 +617,6 @@ function clearModuleMocks() {
|
|
|
1029
617
|
async function run(files, config) {
|
|
1030
618
|
await setupGlobalEnv(config);
|
|
1031
619
|
const workerState = getWorkerState();
|
|
1032
|
-
const envs = ["node", "jsdom", "happy-dom"];
|
|
1033
620
|
const filesWithEnv = await Promise.all(files.map(async (file) => {
|
|
1034
621
|
var _a;
|
|
1035
622
|
const code = await promises.readFile(file, "utf-8");
|
package/dist/worker.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { m as resolve, a as getWorkerState } from './chunk-utils-global.79a8b1cc.mjs';
|
|
2
|
-
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.
|
|
2
|
+
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.4b58ae05.mjs';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
|
-
import { d as distDir } from './chunk-constants.
|
|
5
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
4
|
+
import { d as distDir } from './chunk-constants.511c6e9b.mjs';
|
|
5
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.1c207219.mjs';
|
|
6
6
|
import { r as rpc } from './chunk-runtime-rpc.5e78af38.mjs';
|
|
7
7
|
import 'tty';
|
|
8
8
|
import 'local-pkg';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"node": ">=v14.16.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
+
"@edge-runtime/vm": "*",
|
|
60
61
|
"@vitest/ui": "*",
|
|
61
62
|
"c8": "*",
|
|
62
63
|
"happy-dom": "*",
|
|
@@ -74,6 +75,9 @@
|
|
|
74
75
|
},
|
|
75
76
|
"jsdom": {
|
|
76
77
|
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"@edge-runtime/vm": {
|
|
80
|
+
"optional": true
|
|
77
81
|
}
|
|
78
82
|
},
|
|
79
83
|
"dependencies": {
|
|
@@ -85,10 +89,11 @@
|
|
|
85
89
|
"local-pkg": "^0.4.1",
|
|
86
90
|
"tinypool": "^0.2.1",
|
|
87
91
|
"tinyspy": "^0.3.3",
|
|
88
|
-
"vite": "^2.9.12"
|
|
92
|
+
"vite": "^2.9.12 || ^3.0.0-0"
|
|
89
93
|
},
|
|
90
94
|
"devDependencies": {
|
|
91
95
|
"@antfu/install-pkg": "^0.1.0",
|
|
96
|
+
"@edge-runtime/vm": "1.1.0-beta.10",
|
|
92
97
|
"@sinonjs/fake-timers": "^9.1.2",
|
|
93
98
|
"@types/diff": "^5.0.2",
|
|
94
99
|
"@types/jsdom": "^16.2.14",
|
|
@@ -96,7 +101,7 @@
|
|
|
96
101
|
"@types/natural-compare": "^1.4.1",
|
|
97
102
|
"@types/prompts": "^2.4.0",
|
|
98
103
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
99
|
-
"@vitest/ui": "0.
|
|
104
|
+
"@vitest/ui": "0.17.0",
|
|
100
105
|
"birpc": "^0.2.3",
|
|
101
106
|
"c8": "^7.11.3",
|
|
102
107
|
"cac": "^6.7.12",
|
|
@@ -124,7 +129,7 @@
|
|
|
124
129
|
"source-map-js": "^1.0.2",
|
|
125
130
|
"strip-ansi": "^7.0.1",
|
|
126
131
|
"typescript": "^4.7.4",
|
|
127
|
-
"vite-node": "0.
|
|
132
|
+
"vite-node": "0.17.0",
|
|
128
133
|
"ws": "^8.8.0"
|
|
129
134
|
},
|
|
130
135
|
"scripts": {
|