vitest 0.15.2 → 0.17.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.
Files changed (26) hide show
  1. package/dist/{chunk-api-setup.8cd5e92a.mjs → chunk-api-setup.c728e251.mjs} +4 -4
  2. package/dist/{chunk-constants.7b9cfc82.mjs → chunk-constants.27550afb.mjs} +8 -2
  3. package/dist/chunk-env-node.aa51c4cc.mjs +675 -0
  4. package/dist/{chunk-install-pkg.3fa50769.mjs → chunk-install-pkg.6f5930c3.mjs} +1 -1
  5. package/dist/{chunk-integrations-globals.d0c363a6.mjs → chunk-integrations-globals.3df36e26.mjs} +8 -8
  6. package/dist/{chunk-runtime-chain.7103058b.mjs → chunk-runtime-chain.6d23d202.mjs} +55 -188
  7. package/dist/{chunk-runtime-mocker.d3ca0a4e.mjs → chunk-runtime-mocker.34b9d585.mjs} +36 -62
  8. package/dist/{chunk-runtime-rpc.5e78af38.mjs → chunk-runtime-rpc.d986adb9.mjs} +1 -1
  9. package/dist/{chunk-utils-global.79a8b1cc.mjs → chunk-utils-global.4828c2e2.mjs} +66 -2
  10. package/dist/{chunk-utils-source-map.2556cba8.mjs → chunk-utils-source-map.a9047343.mjs} +9 -23
  11. package/dist/{chunk-vite-node-externalize.0ec89ad1.mjs → chunk-vite-node-externalize.0fc8ed68.mjs} +242 -206
  12. package/dist/{chunk-vite-node-utils.1bbdb2c1.mjs → chunk-vite-node-utils.0f776286.mjs} +29 -14
  13. package/dist/cli.mjs +12 -12
  14. package/dist/config.cjs +5 -1
  15. package/dist/config.d.ts +1 -1
  16. package/dist/config.mjs +5 -1
  17. package/dist/entry.mjs +8 -8
  18. package/dist/index.d.ts +201 -24
  19. package/dist/index.mjs +4 -4
  20. package/dist/node.d.ts +187 -20
  21. package/dist/node.mjs +13 -13
  22. package/dist/{vendor-entry.efeeaa5c.mjs → vendor-entry.1ad8a08d.mjs} +18 -424
  23. package/dist/{vendor-index.e5dc6622.mjs → vendor-index.a2a385d8.mjs} +0 -0
  24. package/dist/worker.mjs +12 -11
  25. package/package.json +10 -5
  26. package/dist/chunk-defaults.dc6dc23d.mjs +0 -302
@@ -1,12 +1,11 @@
1
1
  import { promises } from 'fs';
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 { importModule } from 'local-pkg';
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.7103058b.mjs';
2
+ import { v as isNode, a as getWorkerState, R as RealDate, h as safeClearTimeout, f as safeSetTimeout, F as toArray, Q as deepClone, O as getType, u as relative, S as partitionSuiteChildren, E as shuffle, T as hasTests, y as hasFailed, e as getFullName, k as resetModules } from './chunk-utils-global.4828c2e2.mjs';
3
+ import { d as environments, t as takeCoverage, p as pLimit, f as envs } from './chunk-env-node.aa51c4cc.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, 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.6d23d202.mjs';
5
5
  import chai, { assert, should, util } from 'chai';
6
- import { r as rpc } from './chunk-runtime-rpc.5e78af38.mjs';
7
- import { t as takeCoverage, p as pLimit } from './chunk-defaults.dc6dc23d.mjs';
6
+ import { r as rpc } from './chunk-runtime-rpc.d986adb9.mjs';
8
7
  import { format } from 'util';
9
- import { s as stringify } from './chunk-utils-source-map.2556cba8.mjs';
8
+ import { s as stringify } from './chunk-utils-source-map.a9047343.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.d0c363a6.mjs')).registerApiGlobally();
48
+ (await import('./chunk-integrations-globals.3df36e26.mjs')).registerApiGlobally();
442
49
  }
443
50
  function setupDefines(defines) {
444
51
  for (const key in defines)
@@ -560,9 +167,9 @@ async function withEnv(name, options, fn) {
560
167
  }
561
168
  async function runSetupFiles(config) {
562
169
  const files = toArray(config.setupFiles);
563
- await Promise.all(files.map(async (file) => {
564
- getWorkerState().moduleCache.delete(file);
565
- await import(file);
170
+ await Promise.all(files.map(async (fsPath) => {
171
+ getWorkerState().moduleCache.delete(fsPath);
172
+ await import(fsPath);
566
173
  }));
567
174
  }
568
175
 
@@ -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 = __spreadProps(__spreadValues({}, t.result), { state: "skip" });
522
+ t.result = { ...t.result, state: "skip" };
935
523
  updateTask(t);
936
524
  if (t.type === "suite")
937
525
  markTasksAsSkipped(t);
@@ -958,11 +546,18 @@ async function runSuite(suite) {
958
546
  } else {
959
547
  try {
960
548
  const beforeAllCleanups = await callSuiteHook(suite, suite, "beforeAll", [suite]);
961
- for (const tasksGroup of partitionSuiteChildren(suite)) {
549
+ for (let tasksGroup of partitionSuiteChildren(suite)) {
962
550
  if (tasksGroup[0].concurrent === true) {
963
551
  const mutex = pLimit(workerState.config.maxConcurrency);
964
552
  await Promise.all(tasksGroup.map((c) => mutex(() => runSuiteChild(c))));
965
553
  } else {
554
+ const { sequence } = workerState.config;
555
+ if (sequence.shuffle || suite.shuffle) {
556
+ const suites = tasksGroup.filter((group) => group.type === "suite");
557
+ const tests = tasksGroup.filter((group) => group.type === "test");
558
+ const groups = shuffle([suites, tests], sequence.seed);
559
+ tasksGroup = groups.flatMap((group) => shuffle(group, sequence.seed));
560
+ }
966
561
  for (const c of tasksGroup)
967
562
  await runSuiteChild(c);
968
563
  }
@@ -1029,7 +624,6 @@ function clearModuleMocks() {
1029
624
  async function run(files, config) {
1030
625
  await setupGlobalEnv(config);
1031
626
  const workerState = getWorkerState();
1032
- const envs = ["node", "jsdom", "happy-dom"];
1033
627
  const filesWithEnv = await Promise.all(files.map(async (file) => {
1034
628
  var _a;
1035
629
  const code = await promises.readFile(file, "utf-8");
package/dist/worker.mjs CHANGED
@@ -1,8 +1,9 @@
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.1bbdb2c1.mjs';
3
- import { d as distDir } from './chunk-constants.7b9cfc82.mjs';
4
- import { e as executeInViteNode } from './chunk-runtime-mocker.d3ca0a4e.mjs';
5
- import { r as rpc } from './chunk-runtime-rpc.5e78af38.mjs';
1
+ import { q as resolve, a as getWorkerState } from './chunk-utils-global.4828c2e2.mjs';
2
+ import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.0f776286.mjs';
3
+ import { workerId } from 'tinypool';
4
+ import { d as distDir } from './chunk-constants.27550afb.mjs';
5
+ import { e as executeInViteNode } from './chunk-runtime-mocker.34b9d585.mjs';
6
+ import { r as rpc } from './chunk-runtime-rpc.d986adb9.mjs';
6
7
  import 'tty';
7
8
  import 'local-pkg';
8
9
  import 'path';
@@ -55,9 +56,9 @@ async function startViteNode(ctx) {
55
56
  function init(ctx) {
56
57
  if (typeof __vitest_worker__ !== "undefined" && ctx.config.threads && ctx.config.isolate)
57
58
  throw new Error(`worker for ${ctx.files.join(",")} already initialized by ${getWorkerState().ctx.files.join(",")}. This is probably an internal bug of Vitest.`);
58
- const { config, port, workerId, poolId } = ctx;
59
- process.env.VITEST_WORKER_ID = String(workerId);
60
- process.env.VITEST_POOL_ID = String(poolId);
59
+ const { config, port, workerId: workerId$1 } = ctx;
60
+ process.env.VITEST_WORKER_ID = String(workerId$1);
61
+ process.env.VITEST_POOL_ID = String(workerId);
61
62
  globalThis.__vitest_worker__ = {
62
63
  ctx,
63
64
  moduleCache,
@@ -74,9 +75,9 @@ function init(ctx) {
74
75
  })
75
76
  };
76
77
  if (ctx.invalidates) {
77
- ctx.invalidates.forEach((i) => {
78
- moduleCache.delete(i);
79
- moduleCache.delete(`${i}__mock`);
78
+ ctx.invalidates.forEach((fsPath) => {
79
+ moduleCache.delete(fsPath);
80
+ moduleCache.delete(`${fsPath}__mock`);
80
81
  });
81
82
  }
82
83
  ctx.files.forEach((i) => moduleCache.delete(i));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.15.2",
3
+ "version": "0.17.1",
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": {
@@ -83,12 +87,13 @@
83
87
  "chai": "^4.3.6",
84
88
  "debug": "^4.3.4",
85
89
  "local-pkg": "^0.4.1",
86
- "tinypool": "^0.1.3",
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.15.2",
104
+ "@vitest/ui": "0.17.1",
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.15.2",
132
+ "vite-node": "0.17.1",
128
133
  "ws": "^8.8.0"
129
134
  },
130
135
  "scripts": {