vitest 0.0.112 → 0.0.116
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.md +61 -33
- package/dist/cli.js +1110 -32
- package/dist/{constants-2b0310b7.js → constants-080f26e8.js} +2 -2
- package/dist/{diff-66d6bb83.js → diff-80c47cfa.js} +3299 -3298
- package/dist/entry.js +122 -30
- package/dist/{global-201fd559.js → global-a73dfade.js} +6 -6
- package/dist/{index-8ab26d25.js → index-1af8810e.js} +231 -1191
- package/dist/{index-61c8686f.js → index-648e7ab2.js} +62 -62
- package/dist/index-6e709f57.js +781 -0
- package/dist/{index-2bb9fd4d.js → index-80d9a771.js} +2 -2
- package/dist/{utils-cb6b1266.js → index-bf29f0e6.js} +37 -3
- package/dist/{index-9f4b9905.js → index-ce49e384.js} +33 -800
- package/dist/index-e909c175.js +62 -0
- package/dist/index.d.ts +110 -35
- package/dist/index.js +5 -4
- package/dist/{jest-mock-a57b745c.js → jest-mock-4a754991.js} +1 -12
- package/dist/magic-string.es-94000aea.js +1360 -0
- package/dist/node.d.ts +88 -16
- package/dist/node.js +9 -6
- package/dist/rpc-8c7cc374.js +5 -0
- package/dist/setup-95b119ff.js +4318 -0
- package/dist/utils.js +3 -2
- package/dist/{vi-cb9e4e4e.js → vi-b3412f83.js} +4 -5
- package/dist/worker.js +23 -37
- package/package.json +6 -5
- package/vitest.mjs +1 -20
- package/dist/middleware-2028dfa0.js +0 -81
- package/dist/rpc-7de86f29.js +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-
|
|
1
|
+
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-b3412f83.js';
|
|
2
2
|
import chai, { assert, should } from 'chai';
|
|
3
|
-
import { s as spies, a as spyOn, f as fn } from './jest-mock-
|
|
3
|
+
import { s as spies, a as spyOn, f as fn } from './jest-mock-4a754991.js';
|
|
4
4
|
|
|
5
5
|
const beforeAll = (fn, timeout) => getCurrentSuite().on("beforeAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
|
|
6
6
|
const afterAll = (fn, timeout) => getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
1
2
|
import require$$0 from 'tty';
|
|
2
3
|
import { isPackageExists } from 'local-pkg';
|
|
3
4
|
import path from 'path';
|
|
@@ -248,6 +249,7 @@ const index = {
|
|
|
248
249
|
..._path
|
|
249
250
|
};
|
|
250
251
|
|
|
252
|
+
const isWindows = process.platform === "win32";
|
|
251
253
|
function toArray(array) {
|
|
252
254
|
array = array || [];
|
|
253
255
|
if (Array.isArray(array))
|
|
@@ -332,7 +334,8 @@ function getFullName(task) {
|
|
|
332
334
|
async function ensurePackageInstalled(dependency, promptInstall = !process.env.CI && process.stdout.isTTY) {
|
|
333
335
|
if (isPackageExists(dependency))
|
|
334
336
|
return true;
|
|
335
|
-
|
|
337
|
+
process.stderr.write(c.red(`${c.inverse(c.red(" MISSING DEP "))} Can not find dependency '${dependency}'
|
|
338
|
+
|
|
336
339
|
`));
|
|
337
340
|
if (!promptInstall)
|
|
338
341
|
return false;
|
|
@@ -343,10 +346,41 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
|
|
|
343
346
|
message: c.reset(`Do you want to install ${c.green(dependency)}?`)
|
|
344
347
|
});
|
|
345
348
|
if (install) {
|
|
346
|
-
await (await import('./index-
|
|
349
|
+
await (await import('./index-ce49e384.js')).installPackage(dependency, { dev: true });
|
|
347
350
|
return true;
|
|
348
351
|
}
|
|
349
352
|
return false;
|
|
350
353
|
}
|
|
354
|
+
function deepMerge(target, ...sources) {
|
|
355
|
+
if (!sources.length)
|
|
356
|
+
return target;
|
|
357
|
+
const source = sources.shift();
|
|
358
|
+
if (source === void 0)
|
|
359
|
+
return target;
|
|
360
|
+
if (isMergableObject(target) && isMergableObject(source)) {
|
|
361
|
+
Object.keys(source).forEach((key) => {
|
|
362
|
+
if (isMergableObject(source[key])) {
|
|
363
|
+
if (!target[key])
|
|
364
|
+
target[key] = {};
|
|
365
|
+
deepMerge(target[key], source[key]);
|
|
366
|
+
} else {
|
|
367
|
+
target[key] = source[key];
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return deepMerge(target, ...sources);
|
|
372
|
+
}
|
|
373
|
+
function isMergableObject(item) {
|
|
374
|
+
return isObject(item) && !Array.isArray(item);
|
|
375
|
+
}
|
|
376
|
+
function isObject(val) {
|
|
377
|
+
return toString.call(val) === "[object Object]";
|
|
378
|
+
}
|
|
379
|
+
function toFilePath(id, root) {
|
|
380
|
+
let absolute = slash(id).startsWith("/@fs/") ? id.slice(4) : id.startsWith(dirname(root)) ? id : id.startsWith("/") ? slash(resolve(root, id.slice(1))) : id;
|
|
381
|
+
if (absolute.startsWith("//"))
|
|
382
|
+
absolute = absolute.slice(1);
|
|
383
|
+
return isWindows && absolute.startsWith("/") ? fileURLToPath(pathToFileURL(absolute.slice(1)).href) : absolute;
|
|
384
|
+
}
|
|
351
385
|
|
|
352
|
-
export {
|
|
386
|
+
export { isAbsolute as a, basename as b, c, dirname as d, ensurePackageInstalled as e, getSuites as f, getFullName as g, hasFailed as h, isObject as i, getTests as j, resolve as k, deepMerge as l, toFilePath as m, noop as n, notNullish as o, mergeSlashes as p, index as q, relative as r, slash as s, toArray as t, getNames as u, interpretOnlyMode as v, partitionSuiteChildren as w, hasTests as x, isWindows as y, getTasks as z };
|