vitest 0.0.111 → 0.0.115
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 +34 -5
- package/dist/cli.js +1110 -32
- package/dist/{constants-2b0310b7.js → constants-5968a78c.js} +2 -2
- package/dist/{diff-66d6bb83.js → diff-67678e1f.js} +3299 -3298
- package/dist/entry.js +84 -26
- package/dist/{global-201fd559.js → global-bc40af7c.js} +6 -6
- package/dist/{index-61c8686f.js → index-648e7ab2.js} +62 -62
- package/dist/index-6e709f57.js +781 -0
- package/dist/{utils-cb6b1266.js → index-7c024e16.js} +35 -2
- package/dist/{index-2bb9fd4d.js → index-7f57c252.js} +2 -2
- package/dist/{index-8ab26d25.js → index-b4f86684.js} +216 -1181
- package/dist/{index-9f4b9905.js → index-ce49e384.js} +33 -800
- package/dist/index-e909c175.js +62 -0
- package/dist/index.d.ts +102 -26
- 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/{middleware-2028dfa0.js → middleware-647438b9.js} +2 -2
- package/dist/node.d.ts +79 -6
- package/dist/node.js +9 -6
- package/dist/rpc-8c7cc374.js +5 -0
- package/dist/utils.js +3 -2
- package/dist/{vi-cb9e4e4e.js → vi-2115c609.js} +14 -4
- package/dist/worker.js +23 -37
- package/package.json +3 -1
- package/vitest.mjs +1 -20
- package/dist/rpc-7de86f29.js +0 -10
|
@@ -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))
|
|
@@ -343,10 +345,41 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
|
|
|
343
345
|
message: c.reset(`Do you want to install ${c.green(dependency)}?`)
|
|
344
346
|
});
|
|
345
347
|
if (install) {
|
|
346
|
-
await (await import('./index-
|
|
348
|
+
await (await import('./index-ce49e384.js')).installPackage(dependency, { dev: true });
|
|
347
349
|
return true;
|
|
348
350
|
}
|
|
349
351
|
return false;
|
|
350
352
|
}
|
|
353
|
+
function deepMerge(target, ...sources) {
|
|
354
|
+
if (!sources.length)
|
|
355
|
+
return target;
|
|
356
|
+
const source = sources.shift();
|
|
357
|
+
if (source === void 0)
|
|
358
|
+
return target;
|
|
359
|
+
if (isMergableObject(target) && isMergableObject(source)) {
|
|
360
|
+
Object.keys(source).forEach((key) => {
|
|
361
|
+
if (isMergableObject(source[key])) {
|
|
362
|
+
if (!target[key])
|
|
363
|
+
target[key] = {};
|
|
364
|
+
deepMerge(target[key], source[key]);
|
|
365
|
+
} else {
|
|
366
|
+
target[key] = source[key];
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return deepMerge(target, ...sources);
|
|
371
|
+
}
|
|
372
|
+
function isMergableObject(item) {
|
|
373
|
+
return isObject(item) && !Array.isArray(item);
|
|
374
|
+
}
|
|
375
|
+
function isObject(val) {
|
|
376
|
+
return toString.call(val) === "[object Object]";
|
|
377
|
+
}
|
|
378
|
+
function toFilePath(id, root) {
|
|
379
|
+
let absolute = slash(id).startsWith("/@fs/") ? id.slice(4) : id.startsWith(dirname(root)) ? id : id.startsWith("/") ? slash(resolve(root, id.slice(1))) : id;
|
|
380
|
+
if (absolute.startsWith("//"))
|
|
381
|
+
absolute = absolute.slice(1);
|
|
382
|
+
return isWindows && absolute.startsWith("/") ? fileURLToPath(pathToFileURL(absolute.slice(1)).href) : absolute;
|
|
383
|
+
}
|
|
351
384
|
|
|
352
|
-
export {
|
|
385
|
+
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 };
|
|
@@ -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-2115c609.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()));
|