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.
@@ -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-9f4b9905.js')).installPackage(dependency, { dev: true });
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 { getTests as a, basename as b, c, dirname as d, ensurePackageInstalled as e, getSuites as f, getFullName as g, resolve as h, isAbsolute as i, hasFailed as j, notNullish as k, index as l, mergeSlashes as m, noop as n, getNames as o, interpretOnlyMode as p, partitionSuiteChildren as q, relative as r, slash as s, toArray as t, hasTests as u, getTasks as v };
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-cb9e4e4e.js';
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-a57b745c.js';
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()));