vitest 0.8.5 → 0.9.2
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.da2f55ae.js → chunk-api-setup.7290422e.js} +4 -4
- package/dist/{chunk-constants.76cf224a.js → chunk-constants.e59013dc.js} +1 -1
- package/dist/{chunk-defaults.e85b72aa.js → chunk-defaults.9aa0ce42.js} +1 -1
- package/dist/{chunk-integrations-globals.3713535d.js → chunk-integrations-globals.c040aaa9.js} +5 -6
- package/dist/{chunk-runtime-chain.c86f1eb0.js → chunk-runtime-chain.94cf66a4.js} +195 -2615
- package/dist/{chunk-runtime-mocker.7cc59bee.js → chunk-runtime-mocker.7f4b1850.js} +6 -5
- package/dist/chunk-runtime-rpc.4b80b6bd.js +7 -0
- package/dist/{chunk-utils-base.aff0a195.js → chunk-utils-global.10dcdfa6.js} +18 -1
- package/dist/{chunk-utils-timers.5657f2a4.js → chunk-utils-timers.4800834c.js} +2433 -10
- package/dist/{chunk-vite-node-externalize.e472da7d.js → chunk-vite-node-externalize.ddf2a6fb.js} +56 -19
- package/dist/{chunk-vite-node-utils.a6890356.js → chunk-vite-node-utils.7f0053fb.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/entry.js +8 -8
- package/dist/index.d.ts +10 -6
- package/dist/index.js +4 -5
- package/dist/node.d.ts +4 -1
- package/dist/node.js +7 -8
- package/dist/worker.js +5 -6
- package/package.json +4 -4
- package/dist/chunk-runtime-rpc.5263102e.js +0 -8
- package/dist/chunk-utils-global.7bcfa03c.js +0 -5
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
1
|
+
import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.7f0053fb.js';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
|
-
import {
|
|
3
|
+
import { g as getWorkerState, B as isWindows, C as mergeSlashes, k as dirname, h as basename, w as resolve, s as slash } from './chunk-utils-global.10dcdfa6.js';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { d as distDir } from './chunk-constants.
|
|
6
|
-
import { g as getWorkerState } from './chunk-utils-global.7bcfa03c.js';
|
|
5
|
+
import { d as distDir } from './chunk-constants.e59013dc.js';
|
|
7
6
|
|
|
8
7
|
var __defProp = Object.defineProperty;
|
|
9
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -31,7 +30,9 @@ function getAllProperties(obj) {
|
|
|
31
30
|
if (curr === Object.prototype || curr === Function.prototype || curr === RegExp.prototype)
|
|
32
31
|
break;
|
|
33
32
|
const props = Object.getOwnPropertyNames(curr);
|
|
33
|
+
const symbs = Object.getOwnPropertySymbols(curr);
|
|
34
34
|
props.forEach((prop) => allProps.add(prop));
|
|
35
|
+
symbs.forEach((symb) => allProps.add(symb));
|
|
35
36
|
} while (curr = Object.getPrototypeOf(curr));
|
|
36
37
|
return Array.from(allProps);
|
|
37
38
|
}
|
|
@@ -185,7 +186,7 @@ const _VitestMocker = class {
|
|
|
185
186
|
async ensureSpy() {
|
|
186
187
|
if (_VitestMocker.spyModule)
|
|
187
188
|
return;
|
|
188
|
-
_VitestMocker.spyModule = await this.request(resolve(distDir, "spy.js"));
|
|
189
|
+
_VitestMocker.spyModule = await this.request(`/@fs/${slash(resolve(distDir, "spy.js"))}`);
|
|
189
190
|
}
|
|
190
191
|
async requestWithMock(dep) {
|
|
191
192
|
var _a;
|
|
@@ -248,6 +248,10 @@ const index = {
|
|
|
248
248
|
..._path
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
+
function getWorkerState() {
|
|
252
|
+
return globalThis.__vitest_worker__;
|
|
253
|
+
}
|
|
254
|
+
|
|
251
255
|
function notNullish(v) {
|
|
252
256
|
return v != null;
|
|
253
257
|
}
|
|
@@ -349,6 +353,19 @@ function partitionSuiteChildren(suite) {
|
|
|
349
353
|
tasksGroups.push(tasksGroup);
|
|
350
354
|
return tasksGroups;
|
|
351
355
|
}
|
|
356
|
+
function resetModules() {
|
|
357
|
+
const modules = getWorkerState().moduleCache;
|
|
358
|
+
const vitestPaths = [
|
|
359
|
+
/\/vitest\/dist\//,
|
|
360
|
+
/vitest-virtual-\w+\/dist/,
|
|
361
|
+
/@vitest\/dist/
|
|
362
|
+
];
|
|
363
|
+
modules.forEach((_, path) => {
|
|
364
|
+
if (vitestPaths.some((re) => re.test(path)))
|
|
365
|
+
return;
|
|
366
|
+
modules.delete(path);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
352
369
|
function getFullName(task) {
|
|
353
370
|
return getNames(task).join(c.dim(" > "));
|
|
354
371
|
}
|
|
@@ -405,4 +422,4 @@ function getCallLastIndex(code) {
|
|
|
405
422
|
return null;
|
|
406
423
|
}
|
|
407
424
|
|
|
408
|
-
export {
|
|
425
|
+
export { extname as A, isWindows as B, mergeSlashes as C, partitionSuiteChildren as D, hasTests as E, index as a, getCallLastIndex as b, getNames as c, assertTypes as d, c as e, notNullish as f, getWorkerState as g, basename as h, isObject as i, join as j, dirname as k, isAbsolute as l, relative as m, noop as n, getTests as o, getFullName as p, hasFailed as q, resetModules as r, slash as s, toArray as t, hasFailedSnapshot as u, getSuites as v, resolve as w, deepMerge as x, toNamespacedPath as y, ensurePackageInstalled as z };
|