vitest 0.12.6 → 0.12.7

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 (27) hide show
  1. package/LICENSE.md +0 -72
  2. package/dist/{chunk-api-setup.02588d9f.js → chunk-api-setup.2f2df7e0.js} +5 -4
  3. package/dist/{chunk-constants.7180775c.js → chunk-constants.3570739f.js} +1 -1
  4. package/dist/{chunk-defaults.9e0c233e.js → chunk-defaults.7d81a6ca.js} +1 -1
  5. package/dist/{chunk-install-pkg.078f5345.js → chunk-install-pkg.fd8d1022.js} +9 -11
  6. package/dist/chunk-integrations-globals.36dc71fa.js +26 -0
  7. package/dist/{chunk-magic-string.d5e0e473.js → chunk-magic-string.41232190.js} +0 -4
  8. package/dist/{chunk-runtime-chain.5cae775c.js → chunk-runtime-chain.5021a6b6.js} +22 -21
  9. package/dist/{chunk-runtime-mocker.43db6608.js → chunk-runtime-mocker.42fa71a8.js} +3 -3
  10. package/dist/{chunk-runtime-rpc.ad208eea.js → chunk-runtime-rpc.47bae3f9.js} +1 -1
  11. package/dist/{chunk-utils-global.29e8a0a3.js → chunk-utils-global.2fab7e5c.js} +2 -8
  12. package/dist/{chunk-utils-timers.64f2cbe8.js → chunk-utils-timers.da6ac0a6.js} +1 -1
  13. package/dist/{chunk-vite-node-externalize.35ad761d.js → chunk-vite-node-externalize.0aac0c8e.js} +41 -36
  14. package/dist/{chunk-vite-node-utils.26c328fa.js → chunk-vite-node-utils.9975fd9e.js} +4 -1063
  15. package/dist/cli.js +11 -9
  16. package/dist/config.d.ts +6 -3
  17. package/dist/entry.js +7 -6
  18. package/dist/index.d.ts +248 -251
  19. package/dist/index.js +5 -4
  20. package/dist/node.d.ts +215 -0
  21. package/dist/node.js +13 -11
  22. package/dist/vendor-_commonjsHelpers.addc3445.js +3 -0
  23. package/dist/{vendor-entry.5c1e6d94.js → vendor-entry.7d6cc1fd.js} +26 -85
  24. package/dist/{vendor-index.3ff91c47.js → vendor-index.6c69a0a8.js} +5 -5
  25. package/dist/worker.js +6 -5
  26. package/package.json +8 -7
  27. package/dist/chunk-integrations-globals.cf24723d.js +0 -25
package/LICENSE.md CHANGED
@@ -427,33 +427,6 @@ Repository: git@github.com:moxystudio/node-cross-spawn.git
427
427
 
428
428
  ---------------------------------------
429
429
 
430
- ## debug
431
- License: MIT
432
- By: Josh Junon, TJ Holowaychuk, Nathan Rajlich, Andrew Rhyne
433
- Repository: git://github.com/debug-js/debug.git
434
-
435
- > (The MIT License)
436
- >
437
- > Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
438
- > Copyright (c) 2018-2021 Josh Junon
439
- >
440
- > Permission is hereby granted, free of charge, to any person obtaining a copy of this software
441
- > and associated documentation files (the 'Software'), to deal in the Software without restriction,
442
- > including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
443
- > and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
444
- > subject to the following conditions:
445
- >
446
- > The above copyright notice and this permission notice shall be included in all copies or substantial
447
- > portions of the Software.
448
- >
449
- > THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
450
- > LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
451
- > IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
452
- > WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
453
- > SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
454
-
455
- ---------------------------------------
456
-
457
430
  ## diff
458
431
  License: BSD-3-Clause
459
432
  Repository: git://github.com/kpdecker/jsdiff.git
@@ -1294,34 +1267,6 @@ Repository: unjs/mlly
1294
1267
 
1295
1268
  ---------------------------------------
1296
1269
 
1297
- ## ms
1298
- License: MIT
1299
- Repository: zeit/ms
1300
-
1301
- > The MIT License (MIT)
1302
- >
1303
- > Copyright (c) 2016 Zeit, Inc.
1304
- >
1305
- > Permission is hereby granted, free of charge, to any person obtaining a copy
1306
- > of this software and associated documentation files (the "Software"), to deal
1307
- > in the Software without restriction, including without limitation the rights
1308
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1309
- > copies of the Software, and to permit persons to whom the Software is
1310
- > furnished to do so, subject to the following conditions:
1311
- >
1312
- > The above copyright notice and this permission notice shall be included in all
1313
- > copies or substantial portions of the Software.
1314
- >
1315
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1316
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1317
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1318
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1319
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1320
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1321
- > SOFTWARE.
1322
-
1323
- ---------------------------------------
1324
-
1325
1270
  ## natural-compare
1326
1271
  License: MIT
1327
1272
  By: Lauri Rooden
@@ -1947,23 +1892,6 @@ Repository: sindresorhus/strip-final-newline
1947
1892
 
1948
1893
  ---------------------------------------
1949
1894
 
1950
- ## supports-color
1951
- License: MIT
1952
- By: Sindre Sorhus
1953
- Repository: chalk/supports-color
1954
-
1955
- > MIT License
1956
- >
1957
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
1958
- >
1959
- > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1960
- >
1961
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1962
- >
1963
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1964
-
1965
- ---------------------------------------
1966
-
1967
1895
  ## to-regex-range
1968
1896
  License: MIT
1969
1897
  By: Jon Schlinkert, Rouven Weßling
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'fs';
2
- import { b as createBirpc } from './chunk-vite-node-utils.26c328fa.js';
2
+ import { c as createBirpc } from './chunk-vite-node-utils.9975fd9e.js';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
5
5
  import require$$3 from 'net';
@@ -9,16 +9,17 @@ import require$$2 from 'events';
9
9
  import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
11
  import url from 'url';
12
- import { A as API_PATH } from './chunk-constants.7180775c.js';
13
- import { r as interpretSourcePos, b as parseStacktrace } from './chunk-utils-timers.64f2cbe8.js';
12
+ import { A as API_PATH } from './chunk-constants.3570739f.js';
13
+ import { r as interpretSourcePos, b as parseStacktrace } from './chunk-utils-timers.da6ac0a6.js';
14
14
  import 'module';
15
15
  import 'vm';
16
- import './chunk-utils-global.29e8a0a3.js';
16
+ import './chunk-utils-global.2fab7e5c.js';
17
17
  import 'tty';
18
18
  import 'local-pkg';
19
19
  import 'path';
20
20
  import 'assert';
21
21
  import 'util';
22
+ import 'debug';
22
23
 
23
24
  /*! (c) 2020 Andrea Giammarchi */
24
25
 
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from 'url';
2
- import { k as resolve } from './chunk-utils-global.29e8a0a3.js';
2
+ import { h as resolve } from './chunk-utils-global.2fab7e5c.js';
3
3
 
4
4
  const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
5
5
  const defaultPort = 51204;
@@ -1,7 +1,7 @@
1
1
  import { existsSync, promises } from 'fs';
2
2
  import { createRequire } from 'module';
3
3
  import { pathToFileURL } from 'url';
4
- import { t as toArray, k as resolve } from './chunk-utils-global.29e8a0a3.js';
4
+ import { t as toArray, h as resolve } from './chunk-utils-global.2fab7e5c.js';
5
5
 
6
6
  const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
7
7
  const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
@@ -1,12 +1,10 @@
1
1
  import path$2 from 'path';
2
2
  import fs$2 from 'fs';
3
- import require$$1 from 'util';
3
+ import require$$0 from 'util';
4
4
  import childProcess$1 from 'child_process';
5
- import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.3ff91c47.js';
6
- import require$$0 from 'os';
7
- import './chunk-utils-global.29e8a0a3.js';
8
- import 'tty';
9
- import 'local-pkg';
5
+ import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.6c69a0a8.js';
6
+ import require$$0$1 from 'os';
7
+ import './vendor-_commonjsHelpers.addc3445.js';
10
8
  import 'assert';
11
9
  import 'events';
12
10
  import 'buffer';
@@ -208,7 +206,7 @@ var pLocate_1 = pLocate$1;
208
206
 
209
207
  const path$1 = path$2;
210
208
  const fs$1 = fs$2;
211
- const {promisify: promisify$1} = require$$1;
209
+ const {promisify: promisify$1} = require$$0;
212
210
  const pLocate = pLocate_1;
213
211
 
214
212
  const fsStat = promisify$1(fs$1.stat);
@@ -277,7 +275,7 @@ locatePath.exports.sync = (paths, options) => {
277
275
  var pathExists = {exports: {}};
278
276
 
279
277
  const fs = fs$2;
280
- const {promisify} = require$$1;
278
+ const {promisify} = require$$0;
281
279
 
282
280
  const pAccess = promisify(fs.access);
283
281
 
@@ -760,7 +758,7 @@ standard:"posix"};
760
758
  const SIGRTMIN=34;
761
759
  const SIGRTMAX=64;realtime.SIGRTMAX=SIGRTMAX;
762
760
 
763
- Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0;
761
+ Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$1;
764
762
 
765
763
  var _core=core;
766
764
  var _realtime$1=realtime;
@@ -795,7 +793,7 @@ const number=supported?constantSignal:defaultNumber;
795
793
  return {name,number,description,supported,action,forced,standard};
796
794
  };
797
795
 
798
- Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0;
796
+ Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$1;
799
797
 
800
798
  var _signals=signals;
801
799
  var _realtime=realtime;
@@ -1008,7 +1006,7 @@ stdio.exports.node = options => {
1008
1006
  return [...stdio, 'ipc'];
1009
1007
  };
1010
1008
 
1011
- const os = require$$0;
1009
+ const os = require$$0$1;
1012
1010
  const onExit = signalExit.exports;
1013
1011
 
1014
1012
  const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
@@ -0,0 +1,26 @@
1
+ import { g as globalApis } from './chunk-constants.3570739f.js';
2
+ import { i as index } from './vendor-entry.7d6cc1fd.js';
3
+ import 'url';
4
+ import './chunk-utils-global.2fab7e5c.js';
5
+ import 'tty';
6
+ import 'local-pkg';
7
+ import 'path';
8
+ import 'fs';
9
+ import './chunk-runtime-chain.5021a6b6.js';
10
+ import 'chai';
11
+ import './vendor-_commonjsHelpers.addc3445.js';
12
+ import './chunk-runtime-rpc.47bae3f9.js';
13
+ import './chunk-utils-timers.da6ac0a6.js';
14
+ import './chunk-integrations-spy.bee66426.js';
15
+ import 'tinyspy';
16
+ import 'util';
17
+ import './chunk-defaults.7d81a6ca.js';
18
+ import 'module';
19
+
20
+ function registerApiGlobally() {
21
+ globalApis.forEach((api) => {
22
+ globalThis[api] = index[api];
23
+ });
24
+ }
25
+
26
+ export { registerApiGlobally };
@@ -1,8 +1,4 @@
1
- var charToInteger = {};
2
1
  var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
3
- for (var i = 0; i < chars.length; i++) {
4
- charToInteger[chars.charCodeAt(i)] = i;
5
- }
6
2
  function encode(decoded) {
7
3
  var sourceFileIndex = 0; // second field
8
4
  var sourceCodeLine = 0; // third field
@@ -1,10 +1,11 @@
1
1
  import chai$1, { expect as expect$1, AssertionError, util } from 'chai';
2
- import { c as commonjsGlobal, i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, e as assertTypes, p as picocolors, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.29e8a0a3.js';
3
- import { r as rpc } from './chunk-runtime-rpc.ad208eea.js';
2
+ import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
3
+ import { r as rpc } from './chunk-runtime-rpc.47bae3f9.js';
4
+ import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.2fab7e5c.js';
4
5
  import fs, { promises } from 'fs';
5
- import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils, c as setTimeout, d as clearTimeout } from './chunk-utils-timers.64f2cbe8.js';
6
+ import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils, c as setTimeout, d as clearTimeout } from './chunk-utils-timers.da6ac0a6.js';
6
7
  import { i as isMockFunction, s as spyOn, f as fn, a as spies } from './chunk-integrations-spy.bee66426.js';
7
- import require$$1, { format } from 'util';
8
+ import require$$0, { format } from 'util';
8
9
 
9
10
  var __defProp$5 = Object.defineProperty;
10
11
  var __defProps$2 = Object.defineProperties;
@@ -585,7 +586,7 @@ function deepMergeSnapshot(target, source) {
585
586
  }
586
587
 
587
588
  async function saveInlineSnapshots(snapshots) {
588
- const MagicString = (await import('./chunk-magic-string.d5e0e473.js')).default;
589
+ const MagicString = (await import('./chunk-magic-string.41232190.js')).default;
589
590
  const files = new Set(snapshots.map((i) => i.file));
590
591
  await Promise.all(Array.from(files).map(async (file) => {
591
592
  const map = await rpc().getSourceMap(file);
@@ -1051,20 +1052,6 @@ const SnapshotPlugin = (chai, utils) => {
1051
1052
  });
1052
1053
  };
1053
1054
 
1054
- function getRunningMode() {
1055
- return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
1056
- }
1057
- function isWatchMode() {
1058
- return getRunningMode() === "watch";
1059
- }
1060
- function toString(value) {
1061
- try {
1062
- return `${value}`;
1063
- } catch (_error) {
1064
- return "unknown";
1065
- }
1066
- }
1067
-
1068
1055
  const MATCHERS_OBJECT = Symbol.for("matchers-object");
1069
1056
  if (!Object.prototype.hasOwnProperty.call(global, MATCHERS_OBJECT)) {
1070
1057
  const defaultState = {
@@ -1489,6 +1476,13 @@ Number of calls: ${picocolors.exports.bold(spy.mock.calls.length)}
1489
1476
  });
1490
1477
  utils.addMethod(chai.expect, "addSnapshotSerializer", addSerializer);
1491
1478
  };
1479
+ function toString(value) {
1480
+ try {
1481
+ return `${value}`;
1482
+ } catch (_error) {
1483
+ return "unknown";
1484
+ }
1485
+ }
1492
1486
 
1493
1487
  var __defProp$2 = Object.defineProperty;
1494
1488
  var __defProps$1 = Object.defineProperties;
@@ -2956,7 +2950,7 @@ function withGlobal(_global) {
2956
2950
  hrtimePresent && typeof _global.process.hrtime.bigint === "function";
2957
2951
  const nextTickPresent =
2958
2952
  _global.process && typeof _global.process.nextTick === "function";
2959
- const utilPromisify = _global.process && require$$1.promisify;
2953
+ const utilPromisify = _global.process && require$$0.promisify;
2960
2954
  const performancePresent =
2961
2955
  _global.performance && typeof _global.performance.now === "function";
2962
2956
  const hasPerformancePrototype =
@@ -4860,4 +4854,11 @@ class VitestUtils {
4860
4854
  const vitest = new VitestUtils();
4861
4855
  const vi = vitest;
4862
4856
 
4863
- export { getFn as A, getState as B, RealDate as R, isFirstRun as a, beforeAll as b, afterAll as c, describe as d, beforeEach as e, afterEach as f, createExpect as g, expect as h, it as i, vi as j, getRunningMode as k, isWatchMode as l, toString as m, resetRunOnceCounter as n, clearCollectorContext as o, defaultSuite as p, setHooks as q, runOnce as r, suite as s, test as t, getHooks as u, vitest as v, withCallback as w, collectorContext as x, getSnapshotClient as y, setState as z };
4857
+ function getRunningMode() {
4858
+ return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
4859
+ }
4860
+ function isWatchMode() {
4861
+ return getRunningMode() === "watch";
4862
+ }
4863
+
4864
+ export { getState as A, RealDate as R, isFirstRun as a, beforeAll as b, afterAll as c, describe as d, beforeEach as e, afterEach as f, createExpect as g, expect as h, it as i, vi as j, getRunningMode as k, isWatchMode as l, resetRunOnceCounter as m, clearCollectorContext as n, defaultSuite as o, setHooks as p, getHooks as q, runOnce as r, suite as s, test as t, collectorContext as u, vitest as v, withCallback as w, getSnapshotClient as x, setState as y, getFn as z };
@@ -1,8 +1,8 @@
1
- import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.26c328fa.js';
1
+ import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.9975fd9e.js';
2
2
  import { normalizePath } from 'vite';
3
- import { a as getWorkerState, F as isWindows, G as mergeSlashes, d as dirname, k as resolve, h as basename, H as getType, I as getAllProperties, s as slash } from './chunk-utils-global.29e8a0a3.js';
3
+ import { a as getWorkerState, D as isWindows, E as mergeSlashes, d as dirname, h as resolve, f as basename, F as getType, G as getAllProperties, s as slash } from './chunk-utils-global.2fab7e5c.js';
4
4
  import { existsSync, readdirSync } from 'fs';
5
- import { d as distDir } from './chunk-constants.7180775c.js';
5
+ import { d as distDir } from './chunk-constants.3570739f.js';
6
6
 
7
7
  var __defProp = Object.defineProperty;
8
8
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -1,4 +1,4 @@
1
- import { a as getWorkerState } from './chunk-utils-global.29e8a0a3.js';
1
+ import { a as getWorkerState } from './chunk-utils-global.2fab7e5c.js';
2
2
 
3
3
  const rpc = () => {
4
4
  return getWorkerState().rpc;
@@ -2,12 +2,6 @@ import require$$0 from 'tty';
2
2
  import { isPackageExists } from 'local-pkg';
3
3
  import path from 'path';
4
4
 
5
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
-
7
- function getDefaultExportFromCjs (x) {
8
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9
- }
10
-
11
5
  var picocolors = {exports: {}};
12
6
 
13
7
  let tty = require$$0;
@@ -439,7 +433,7 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
439
433
  message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
440
434
  });
441
435
  if (install) {
442
- await (await import('./chunk-install-pkg.078f5345.js')).installPackage(dependency, { dev: true });
436
+ await (await import('./chunk-install-pkg.fd8d1022.js')).installPackage(dependency, { dev: true });
443
437
  process.stderr.write(picocolors.exports.yellow(`
444
438
  Package ${dependency} installed, re-run the command to start.
445
439
  `));
@@ -477,4 +471,4 @@ function getCallLastIndex(code) {
477
471
  return null;
478
472
  }
479
473
 
480
- export { toNamespacedPath as A, ensurePackageInstalled as B, stdout as C, extname as D, getDefaultExportFromCjs as E, isWindows as F, mergeSlashes as G, getType as H, getAllProperties as I, clone as J, partitionSuiteChildren as K, hasTests as L, getWorkerState as a, getNames as b, commonjsGlobal as c, dirname as d, assertTypes as e, notNullish as f, getCallLastIndex as g, basename as h, isObject as i, join as j, resolve as k, isAbsolute as l, relative as m, noop as n, isNode as o, picocolors as p, getTests as q, resetModules as r, slash as s, toArray as t, getFullName as u, hasFailed as v, hasFailedSnapshot as w, getSuites as x, normalize as y, deepMerge as z };
474
+ export { ensurePackageInstalled as A, stdout as B, extname as C, isWindows as D, mergeSlashes as E, getType as F, getAllProperties as G, clone as H, partitionSuiteChildren as I, hasTests as J, getWorkerState as a, getNames as b, assertTypes as c, dirname as d, notNullish as e, basename as f, getCallLastIndex as g, resolve as h, isObject as i, join as j, isAbsolute as k, relative as l, isNode as m, noop as n, getTests as o, picocolors as p, getFullName as q, resetModules as r, slash as s, toArray as t, hasFailed as u, hasFailedSnapshot as v, getSuites as w, normalize as x, deepMerge as y, toNamespacedPath as z };
@@ -1,4 +1,4 @@
1
- import { s as slash, f as notNullish, p as picocolors } from './chunk-utils-global.29e8a0a3.js';
1
+ import { s as slash, e as notNullish, p as picocolors } from './chunk-utils-global.2fab7e5c.js';
2
2
 
3
3
  const setTimeout$1 = globalThis.setTimeout;
4
4
  const setInterval = globalThis.setInterval;
@@ -2,27 +2,30 @@ import { Buffer } from 'buffer';
2
2
  import path$a from 'path';
3
3
  import childProcess from 'child_process';
4
4
  import process$1 from 'process';
5
- import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn, o as onetime$1 } from './vendor-index.3ff91c47.js';
5
+ import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn, o as onetime$1 } from './vendor-index.6c69a0a8.js';
6
6
  import url, { fileURLToPath, pathToFileURL } from 'url';
7
7
  import require$$0, { constants as constants$5, cpus, hostname } from 'os';
8
- import { c as commonjsGlobal, j as join, h as basename, d as dirname, k as resolve, p as picocolors, s as slash$2, l as isAbsolute, m as relative, o as isNode, q as getTests, u as getFullName, v as hasFailed, w as hasFailedSnapshot, x as getSuites, t as toArray, y as normalize, n as noop$1, z as deepMerge, A as toNamespacedPath, g as getCallLastIndex, f as notNullish, B as ensurePackageInstalled, C as stdout } from './chunk-utils-global.29e8a0a3.js';
8
+ import { j as join, f as basename, d as dirname, h as resolve, p as picocolors, s as slash$2, k as isAbsolute, l as relative, m as isNode, o as getTests, q as getFullName, u as hasFailed, v as hasFailedSnapshot, w as getSuites, t as toArray, x as normalize, n as noop$1, y as deepMerge, z as toNamespacedPath, g as getCallLastIndex, e as notNullish, A as ensurePackageInstalled, B as stdout } from './chunk-utils-global.2fab7e5c.js';
9
9
  import { createServer, mergeConfig } from 'vite';
10
10
  import fs$8, { promises, existsSync, readFileSync } from 'fs';
11
- import { d as distDir, a as defaultPort, c as configFiles } from './chunk-constants.7180775c.js';
11
+ import { d as distDir, a as defaultPort, c as configFiles } from './chunk-constants.3570739f.js';
12
12
  import readline from 'readline';
13
- import require$$1 from 'util';
14
- import require$$0$1 from 'stream';
13
+ import require$$0$1 from 'util';
14
+ import require$$0$2 from 'stream';
15
15
  import require$$2 from 'events';
16
- import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, c as createDebug, t as toFilePath, w as withInlineSourcemap, b as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.26c328fa.js';
17
- import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.9e0c233e.js';
16
+ import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
17
+ import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.9975fd9e.js';
18
+ import createDebug from 'debug';
19
+ import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.7d81a6ca.js';
18
20
  import { MessageChannel } from 'worker_threads';
19
21
  import { Tinypool } from 'tinypool';
20
22
  import { performance } from 'perf_hooks';
21
- import { e as stripAnsi, h as stringWidth, i as ansiStyles, j as sliceAnsi, k as setInterval, o as clearInterval, q as cliTruncate, c as setTimeout$1, b as parseStacktrace, r as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE, d as clearTimeout$1 } from './chunk-utils-timers.64f2cbe8.js';
22
- import MagicString from './chunk-magic-string.d5e0e473.js';
23
+ import { e as stripAnsi, h as stringWidth, i as ansiStyles, j as sliceAnsi, k as setInterval, o as clearInterval, q as cliTruncate, c as setTimeout$1, b as parseStacktrace, r as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE, d as clearTimeout$1 } from './chunk-utils-timers.da6ac0a6.js';
24
+ import { resolveModule } from 'local-pkg';
25
+ import MagicString from './chunk-magic-string.41232190.js';
23
26
  import { p as prompts } from './vendor-index.405e58ef.js';
24
27
 
25
- var version = "0.12.6";
28
+ var version = "0.12.7";
26
29
 
27
30
  function stripFinalNewline(input) {
28
31
  const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
@@ -2127,7 +2130,7 @@ var toRegexRange_1 = toRegexRange$1;
2127
2130
  * Licensed under the MIT License.
2128
2131
  */
2129
2132
 
2130
- const util$1 = require$$1;
2133
+ const util$1 = require$$0$1;
2131
2134
  const toRegexRange = toRegexRange_1;
2132
2135
 
2133
2136
  const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
@@ -5164,7 +5167,7 @@ var picomatch_1 = picomatch$1;
5164
5167
  module.exports = picomatch_1;
5165
5168
  } (picomatch$2));
5166
5169
 
5167
- const util = require$$1;
5170
+ const util = require$$0$1;
5168
5171
  const braces = braces_1;
5169
5172
  const picomatch = picomatch$2.exports;
5170
5173
  const utils$b = utils$f;
@@ -5808,7 +5811,7 @@ var stream$4 = {};
5808
5811
  * Copyright (c) 2014-2020 Teambition
5809
5812
  * Licensed under the MIT license.
5810
5813
  */
5811
- const Stream = require$$0$1;
5814
+ const Stream = require$$0$2;
5812
5815
  const PassThrough = Stream.PassThrough;
5813
5816
  const slice = Array.prototype.slice;
5814
5817
 
@@ -7092,7 +7095,7 @@ function callSuccessCallback(callback, entries) {
7092
7095
  var stream$1 = {};
7093
7096
 
7094
7097
  Object.defineProperty(stream$1, "__esModule", { value: true });
7095
- const stream_1$5 = require$$0$1;
7098
+ const stream_1$5 = require$$0$2;
7096
7099
  const async_1$2 = async$2;
7097
7100
  class StreamProvider {
7098
7101
  constructor(_root, _settings) {
@@ -7300,7 +7303,7 @@ class Reader {
7300
7303
  reader.default = Reader;
7301
7304
 
7302
7305
  Object.defineProperty(stream$2, "__esModule", { value: true });
7303
- const stream_1$3 = require$$0$1;
7306
+ const stream_1$3 = require$$0$2;
7304
7307
  const fsStat$1 = out$3;
7305
7308
  const fsWalk$1 = out$2;
7306
7309
  const reader_1$1 = reader;
@@ -7698,7 +7701,7 @@ async$6.default = ProviderAsync;
7698
7701
  var stream = {};
7699
7702
 
7700
7703
  Object.defineProperty(stream, "__esModule", { value: true });
7701
- const stream_1$1 = require$$0$1;
7704
+ const stream_1$1 = require$$0$2;
7702
7705
  const stream_2 = stream$2;
7703
7706
  const provider_1$1 = provider;
7704
7707
  class ProviderStream extends provider_1$1.default {
@@ -10026,7 +10029,7 @@ function resolveConfig(options, viteConfig) {
10026
10029
  resolved.maxThreads = parseInt(process.env.VITEST_MAX_THREADS);
10027
10030
  if (process.env.VITEST_MIN_THREADS)
10028
10031
  resolved.minThreads = parseInt(process.env.VITEST_MIN_THREADS);
10029
- resolved.setupFiles = toArray(resolved.setupFiles || []).map((file) => resolve(resolved.root, file));
10032
+ resolved.setupFiles = toArray(resolved.setupFiles || []).map((file) => normalize(resolveModule(file, { paths: [resolved.root] })));
10030
10033
  resolved.api = resolveApiConfig(options);
10031
10034
  if (options.related)
10032
10035
  resolved.related = toArray(options.related).map((file) => resolve(resolved.root, file));
@@ -10081,27 +10084,27 @@ function printErrorType(type, ctx) {
10081
10084
  ctx.error(`
10082
10085
  ${picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` ${type} `))))}`);
10083
10086
  }
10087
+ const skipErrorProperties = [
10088
+ "message",
10089
+ "name",
10090
+ "nameStr",
10091
+ "stack",
10092
+ "cause",
10093
+ "stacks",
10094
+ "stackStr",
10095
+ "type",
10096
+ "showDiff",
10097
+ "actual",
10098
+ "expected",
10099
+ "constructor",
10100
+ "toString"
10101
+ ];
10084
10102
  function getErrorProperties(e) {
10085
10103
  const errorObject = /* @__PURE__ */ Object.create(null);
10086
10104
  if (e.name === "AssertionError")
10087
10105
  return errorObject;
10088
- const skip = [
10089
- "message",
10090
- "name",
10091
- "nameStr",
10092
- "stack",
10093
- "cause",
10094
- "stacks",
10095
- "stackStr",
10096
- "type",
10097
- "showDiff",
10098
- "actual",
10099
- "expected",
10100
- "constructor",
10101
- "toString"
10102
- ];
10103
10106
  for (const key of Object.getOwnPropertyNames(e)) {
10104
- if (!skip.includes(key))
10107
+ if (!skipErrorProperties.includes(key))
10105
10108
  errorObject[key] = e[key];
10106
10109
  }
10107
10110
  return errorObject;
@@ -10918,12 +10921,13 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
10918
10921
  }
10919
10922
  }
10920
10923
  options.defines = defines;
10921
- return {
10924
+ const open = preOptions.ui && preOptions.open ? preOptions.uiBase ?? "/__vitest__/" : void 0;
10925
+ const config = {
10922
10926
  resolve: {
10923
10927
  mainFields: []
10924
10928
  },
10925
10929
  server: __spreadProps(__spreadValues({}, preOptions.api), {
10926
- open: preOptions.ui && preOptions.open ? preOptions.uiBase ?? "/__vitest__/" : void 0,
10930
+ open,
10927
10931
  preTransformRequests: false
10928
10932
  }),
10929
10933
  cacheDir: void 0,
@@ -10932,6 +10936,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
10932
10936
  entries: []
10933
10937
  }
10934
10938
  };
10939
+ return config;
10935
10940
  },
10936
10941
  async configResolved(viteConfig) {
10937
10942
  var _b, _c, _d, _e;
@@ -10953,7 +10958,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
10953
10958
  await ctx.setServer(options, server);
10954
10959
  haveStarted = true;
10955
10960
  if (options.api && options.watch)
10956
- (await import('./chunk-api-setup.02588d9f.js')).setup(ctx);
10961
+ (await import('./chunk-api-setup.2f2df7e0.js')).setup(ctx);
10957
10962
  if (!options.watch)
10958
10963
  await server.watcher.close();
10959
10964
  }