vitest 0.27.3 → 0.28.1

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 (60) hide show
  1. package/LICENSE.md +4 -93
  2. package/browser.d.ts +1 -1
  3. package/dist/browser.d.ts +11 -13
  4. package/dist/browser.js +9 -34
  5. package/dist/{chunk-api-setup.0a2398d8.js → chunk-api-setup.52751a38.js} +26 -12
  6. package/dist/chunk-constants.797d3ebf.js +42 -0
  7. package/dist/{chunk-install-pkg.7b006b3e.js → chunk-install-pkg.e816b731.js} +51 -11
  8. package/dist/{vendor-index.57682f0c.js → chunk-integrations-coverage.48e6286b.js} +33 -4
  9. package/dist/chunk-integrations-globals.0d5f50f0.js +29 -0
  10. package/dist/chunk-integrations-run-once.38756e30.js +27 -0
  11. package/dist/chunk-integrations-utils.f1f6f1ed.js +118 -0
  12. package/dist/{chunk-node-git.59caac18.js → chunk-node-git.d9ad64ab.js} +6 -8
  13. package/dist/{chunk-snapshot-manager.d16903ef.js → chunk-node-pkg.a7963c3f.js} +7440 -172
  14. package/dist/{chunk-runtime-mocker.66533d65.js → chunk-runtime-mocker.03017e8c.js} +13 -12
  15. package/dist/{chunk-runtime-rpc.e79efa9a.js → chunk-runtime-rpc.9c0386cc.js} +3 -2
  16. package/dist/chunk-runtime-setup.d9302cfd.js +20 -0
  17. package/dist/chunk-snapshot-env.6457638e.js +11 -0
  18. package/dist/chunk-utils-base.977ae74f.js +77 -0
  19. package/dist/chunk-utils-env.860d90c2.js +6 -0
  20. package/dist/chunk-utils-global.442d1d33.js +73 -0
  21. package/dist/{chunk-utils-import.eb63557e.js → chunk-utils-import.9911c99d.js} +3289 -169
  22. package/dist/chunk-utils-tasks.1b603032.js +103 -0
  23. package/dist/cli-wrapper.js +7 -6
  24. package/dist/cli.js +16 -15
  25. package/dist/config.d.ts +7 -2
  26. package/dist/entry.js +233 -28
  27. package/dist/env-afee91f0.d.ts +10 -0
  28. package/dist/environments.d.ts +7 -2
  29. package/dist/index.d.ts +160 -11
  30. package/dist/index.js +17 -18
  31. package/dist/loader.js +6 -6
  32. package/dist/node.d.ts +9 -7
  33. package/dist/node.js +18 -17
  34. package/dist/runners-chunk.js +215 -0
  35. package/dist/runners.d.ts +39 -0
  36. package/dist/runners.js +18 -0
  37. package/dist/spy.js +1 -2
  38. package/dist/suite.d.ts +2 -0
  39. package/dist/suite.js +2 -19
  40. package/dist/{types-c1386a7d.d.ts → types-c800444e.d.ts} +160 -425
  41. package/dist/{vendor-index.e6c27006.js → vendor-index.618ca5a1.js} +1078 -10
  42. package/dist/{vendor-index.b0346fe4.js → vendor-index.bdee400f.js} +1 -0
  43. package/dist/worker.js +11 -13
  44. package/package.json +20 -12
  45. package/runners.d.ts +1 -0
  46. package/suite.d.ts +1 -0
  47. package/dist/chunk-integrations-coverage.18366936.js +0 -242
  48. package/dist/chunk-integrations-globals.59b4d460.js +0 -28
  49. package/dist/chunk-mock-date.91595ccd.js +0 -350
  50. package/dist/chunk-runtime-chain.07d16eac.js +0 -2594
  51. package/dist/chunk-runtime-error.f2062967.js +0 -144
  52. package/dist/chunk-runtime-setup.8ca273cd.js +0 -653
  53. package/dist/chunk-utils-env.4ebb0106.js +0 -229
  54. package/dist/chunk-utils-source-map.832515f7.js +0 -408
  55. package/dist/chunk-utils-timers.52534f96.js +0 -3573
  56. package/dist/index-2dd51af4.d.ts +0 -258
  57. package/dist/vendor-index.451e37bc.js +0 -1071
  58. package/dist/vendor-index.723a074f.js +0 -102
  59. package/dist/vendor-index.9c919048.js +0 -61
  60. package/dist/vendor-index.9f20a9be.js +0 -6291
package/LICENSE.md CHANGED
@@ -250,7 +250,7 @@ Repository: chalk/ansi-regex
250
250
 
251
251
  > MIT License
252
252
  >
253
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
253
+ > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
254
254
  >
255
255
  > 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:
256
256
  >
@@ -267,7 +267,7 @@ Repository: chalk/ansi-styles
267
267
 
268
268
  > MIT License
269
269
  >
270
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
270
+ > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
271
271
  >
272
272
  > 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:
273
273
  >
@@ -427,44 +427,6 @@ Repository: git@github.com:moxystudio/node-cross-spawn.git
427
427
 
428
428
  ---------------------------------------
429
429
 
430
- ## diff
431
- License: BSD-3-Clause
432
- Repository: git://github.com/kpdecker/jsdiff.git
433
-
434
- > Software License Agreement (BSD License)
435
- >
436
- > Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
437
- >
438
- > All rights reserved.
439
- >
440
- > Redistribution and use of this software in source and binary forms, with or without modification,
441
- > are permitted provided that the following conditions are met:
442
- >
443
- > * Redistributions of source code must retain the above
444
- > copyright notice, this list of conditions and the
445
- > following disclaimer.
446
- >
447
- > * Redistributions in binary form must reproduce the above
448
- > copyright notice, this list of conditions and the
449
- > following disclaimer in the documentation and/or other
450
- > materials provided with the distribution.
451
- >
452
- > * Neither the name of Kevin Decker nor the names of its
453
- > contributors may be used to endorse or promote products
454
- > derived from this software without specific prior
455
- > written permission.
456
- >
457
- > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
458
- > IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
459
- > FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
460
- > CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
461
- > DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
462
- > DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
463
- > IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
464
- > OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
465
-
466
- ---------------------------------------
467
-
468
430
  ## eastasianwidth
469
431
  License: MIT
470
432
  By: Masaki Komagata
@@ -1466,7 +1428,7 @@ Repository: sindresorhus/mimic-fn
1466
1428
 
1467
1429
  > MIT License
1468
1430
  >
1469
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
1431
+ > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
1470
1432
  >
1471
1433
  > 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:
1472
1434
  >
@@ -1603,7 +1565,7 @@ Repository: sindresorhus/path-key
1603
1565
 
1604
1566
  > MIT License
1605
1567
  >
1606
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
1568
+ > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
1607
1569
  >
1608
1570
  > 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:
1609
1571
  >
@@ -1613,57 +1575,6 @@ Repository: sindresorhus/path-key
1613
1575
 
1614
1576
  ---------------------------------------
1615
1577
 
1616
- ## pathe
1617
- License: MIT
1618
- Repository: unjs/pathe
1619
-
1620
- > MIT License
1621
- >
1622
- > Copyright (c) 2021 UnJS
1623
- >
1624
- > Permission is hereby granted, free of charge, to any person obtaining a copy
1625
- > of this software and associated documentation files (the "Software"), to deal
1626
- > in the Software without restriction, including without limitation the rights
1627
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1628
- > copies of the Software, and to permit persons to whom the Software is
1629
- > furnished to do so, subject to the following conditions:
1630
- >
1631
- > The above copyright notice and this permission notice shall be included in all
1632
- > copies or substantial portions of the Software.
1633
- >
1634
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1635
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1636
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1637
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1638
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1639
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1640
- > SOFTWARE.
1641
- >
1642
- > --------------------------------------------------------------------------------
1643
- >
1644
- > Copyright Joyent, Inc. and other Node contributors.
1645
- >
1646
- > Permission is hereby granted, free of charge, to any person obtaining a
1647
- > copy of this software and associated documentation files (the
1648
- > "Software"), to deal in the Software without restriction, including
1649
- > without limitation the rights to use, copy, modify, merge, publish,
1650
- > distribute, sublicense, and/or sell copies of the Software, and to permit
1651
- > persons to whom the Software is furnished to do so, subject to the
1652
- > following conditions:
1653
- >
1654
- > The above copyright notice and this permission notice shall be included
1655
- > in all copies or substantial portions of the Software.
1656
- >
1657
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1658
- > OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1659
- > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1660
- > NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1661
- > DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1662
- > OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1663
- > USE OR OTHER DEALINGS IN THE SOFTWARE.
1664
-
1665
- ---------------------------------------
1666
-
1667
1578
  ## picomatch
1668
1579
  License: MIT
1669
1580
  By: Jon Schlinkert
package/browser.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/browser'
1
+ export * from './dist/browser.js'
package/dist/browser.d.ts CHANGED
@@ -1,20 +1,18 @@
1
- export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-2dd51af4.js';
2
- import { b as ResolvedConfig } from './types-c1386a7d.js';
3
- export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, j as CSSModuleScopeStrategy, C as CollectLineNumbers, g as CollectLines, ab as Constructable, i as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, aj as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ah as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, c as ModuleGraphData, aa as MutableArray, a5 as Nullable, ai as OnServerRestartHandler, O as OnTestFailedHandler, ag as ParsedStack, e as RawErrsMap, ak as ReportContext, d as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, h as RootAndTarget, m as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, q as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, o as TaskBase, p as TaskResult, T as TaskResultPack, n as TaskState, r as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, f as TscErrorInfo, l as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, k as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-c1386a7d.js';
4
- import * as chai from 'chai';
5
- export { chai };
6
- export { assert, should } from 'chai';
7
- export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
8
- import 'tinyspy';
1
+ export { startTests } from '@vitest/runner';
2
+ import { a as ResolvedConfig } from './types-c800444e.js';
3
+ export { s as setupSnapshotEnvironment } from './env-afee91f0.js';
4
+ import '@vitest/expect';
9
5
  import 'vite';
6
+ import '@vitest/runner/types';
7
+ import '@vitest/runner/utils';
8
+ import '@vitest/utils';
9
+ import 'tinybench';
10
10
  import 'vite-node/client';
11
11
  import 'vite-node/server';
12
+ import 'node:worker_threads';
12
13
  import 'vite-node';
13
14
  import 'node:fs';
14
- import 'node:worker_threads';
15
-
16
- declare function startTests(paths: string[], config: ResolvedConfig): Promise<void>;
17
15
 
18
- declare function setupGlobalEnv(config: ResolvedConfig): Promise<void>;
16
+ declare function setupCommonEnv(config: ResolvedConfig): Promise<void>;
19
17
 
20
- export { setupGlobalEnv, startTests };
18
+ export { setupCommonEnv };
package/dist/browser.js CHANGED
@@ -1,35 +1,10 @@
1
- export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.07d16eac.js';
2
- import { e as dist } from './chunk-utils-import.eb63557e.js';
3
- export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-utils-import.eb63557e.js';
4
- export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.8ca273cd.js';
5
- import * as chai from 'chai';
6
- export { chai };
7
- export { assert, should } from 'chai';
8
- import 'util';
9
- import './chunk-mock-date.91595ccd.js';
10
- import 'node:path';
11
- import 'picocolors';
12
- import 'local-pkg';
13
- import './chunk-utils-env.4ebb0106.js';
14
- import 'node:url';
15
- import 'path';
1
+ export { startTests } from '@vitest/runner';
2
+ export { s as setupCommonEnv } from './chunk-runtime-setup.d9302cfd.js';
3
+ export { s as setupSnapshotEnvironment } from './chunk-snapshot-env.6457638e.js';
4
+ import '@vitest/utils';
5
+ import './chunk-integrations-run-once.38756e30.js';
6
+ import './chunk-utils-global.442d1d33.js';
7
+ import 'pathe';
8
+ import './chunk-utils-env.860d90c2.js';
16
9
  import 'std-env';
17
- import './vendor-_commonjsHelpers.addc3445.js';
18
- import './chunk-utils-timers.52534f96.js';
19
- import './vendor-index.723a074f.js';
20
- import 'tinyspy';
21
- import './chunk-utils-source-map.832515f7.js';
22
- import './chunk-runtime-rpc.e79efa9a.js';
23
- import 'node:fs';
24
- import 'fs';
25
- import 'perf_hooks';
26
- import './chunk-integrations-coverage.18366936.js';
27
- import './chunk-runtime-error.f2062967.js';
28
- import 'vite-node/source-map';
29
- import './chunk-env-node.ffd1183b.js';
30
- import 'node:console';
31
-
32
-
33
-
34
- var expectTypeOf = dist.expectTypeOf;
35
- export { expectTypeOf };
10
+ import '@vitest/runner/utils';
@@ -1,4 +1,4 @@
1
- import { promises } from 'node:fs';
1
+ import { promises, existsSync } from 'node:fs';
2
2
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
3
3
  import require$$0$2 from 'stream';
4
4
  import require$$0 from 'zlib';
@@ -10,16 +10,16 @@ import require$$2 from 'events';
10
10
  import require$$1 from 'https';
11
11
  import require$$2$1 from 'http';
12
12
  import require$$7 from 'url';
13
- import { A as API_PATH } from './chunk-utils-env.4ebb0106.js';
14
- import './chunk-mock-date.91595ccd.js';
15
- import { b as parseStacktrace } from './chunk-utils-source-map.832515f7.js';
13
+ import { A as API_PATH } from './chunk-constants.797d3ebf.js';
14
+ import './chunk-utils-global.442d1d33.js';
15
+ import { a as parseStacktrace } from './chunk-utils-tasks.1b603032.js';
16
16
  import 'node:url';
17
- import 'path';
17
+ import 'pathe';
18
+ import './chunk-utils-env.860d90c2.js';
18
19
  import 'std-env';
19
- import 'node:path';
20
- import 'picocolors';
21
- import 'local-pkg';
22
- import './chunk-utils-timers.52534f96.js';
20
+ import '@vitest/runner/utils';
21
+ import '@vitest/utils';
22
+ import './chunk-utils-base.977ae74f.js';
23
23
 
24
24
  async function getModuleGraph(ctx, id) {
25
25
  const graph = {};
@@ -4518,12 +4518,26 @@ function setup(ctx) {
4518
4518
  getFiles() {
4519
4519
  return ctx.state.getFiles();
4520
4520
  },
4521
- async getPaths() {
4522
- return await ctx.state.getPaths();
4521
+ getPaths() {
4522
+ return ctx.state.getPaths();
4523
4523
  },
4524
- readFile(id) {
4524
+ resolveSnapshotPath(testPath) {
4525
+ return ctx.snapshot.resolvePath(testPath);
4526
+ },
4527
+ removeFile(id) {
4528
+ return promises.unlink(id);
4529
+ },
4530
+ createDirectory(id) {
4531
+ return promises.mkdir(id, { recursive: true });
4532
+ },
4533
+ async readFile(id) {
4534
+ if (!existsSync(id))
4535
+ return null;
4525
4536
  return promises.readFile(id, "utf-8");
4526
4537
  },
4538
+ snapshotSaved(snapshot) {
4539
+ ctx.snapshot.add(snapshot);
4540
+ },
4527
4541
  writeFile(id, content) {
4528
4542
  return promises.writeFile(id, content, "utf-8");
4529
4543
  },
@@ -0,0 +1,42 @@
1
+ import url from 'node:url';
2
+ import { resolve } from 'pathe';
3
+ import { i as isNode } from './chunk-utils-env.860d90c2.js';
4
+
5
+ const rootDir = isNode ? resolve(url.fileURLToPath(import.meta.url), "../../") : import.meta.url;
6
+ const distDir = isNode ? resolve(url.fileURLToPath(import.meta.url), "../../dist") : import.meta.url;
7
+ const defaultPort = 51204;
8
+ const EXIT_CODE_RESTART = 43;
9
+ const API_PATH = "/__vitest_api__";
10
+ const configFiles = [
11
+ "vitest.config.ts",
12
+ "vitest.config.mts",
13
+ "vitest.config.cts",
14
+ "vitest.config.js",
15
+ "vitest.config.mjs",
16
+ "vitest.config.cjs",
17
+ "vite.config.ts",
18
+ "vite.config.mts",
19
+ "vite.config.cts",
20
+ "vite.config.js",
21
+ "vite.config.mjs",
22
+ "vite.config.cjs"
23
+ ];
24
+ const globalApis = [
25
+ "suite",
26
+ "test",
27
+ "describe",
28
+ "it",
29
+ "chai",
30
+ "expect",
31
+ "assert",
32
+ "expectTypeOf",
33
+ "assertType",
34
+ "vitest",
35
+ "vi",
36
+ "beforeAll",
37
+ "afterAll",
38
+ "beforeEach",
39
+ "afterEach"
40
+ ];
41
+
42
+ export { API_PATH as A, EXIT_CODE_RESTART as E, defaultPort as a, configFiles as c, distDir as d, globalApis as g, rootDir as r };
@@ -1,15 +1,55 @@
1
1
  import require$$0 from 'fs';
2
2
  import k from 'path';
3
- import util from 'util';
4
- import require$$0$2 from 'child_process';
5
- import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.e6c27006.js';
6
- import { o as onetime$1 } from './vendor-index.9c919048.js';
7
- import require$$0$1 from 'os';
3
+ import require$$0$1 from 'util';
4
+ import require$$0$3 from 'child_process';
5
+ import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.618ca5a1.js';
6
+ import { o as onetime$1 } from './chunk-node-pkg.a7963c3f.js';
7
+ import require$$0$2 from 'os';
8
+ import 'node:buffer';
9
+ import 'node:path';
10
+ import 'node:child_process';
11
+ import 'node:process';
8
12
  import './vendor-_commonjsHelpers.addc3445.js';
13
+ import 'node:url';
14
+ import 'node:os';
9
15
  import 'assert';
10
16
  import 'events';
11
17
  import 'buffer';
12
18
  import 'stream';
19
+ import 'pathe';
20
+ import './chunk-constants.797d3ebf.js';
21
+ import './chunk-utils-env.860d90c2.js';
22
+ import 'std-env';
23
+ import './chunk-integrations-coverage.48e6286b.js';
24
+ import 'local-pkg';
25
+ import './chunk-env-node.ffd1183b.js';
26
+ import 'node:console';
27
+ import 'picocolors';
28
+ import 'vite';
29
+ import 'node:fs';
30
+ import 'vite-node/client';
31
+ import 'vite-node/server';
32
+ import './chunk-utils-global.442d1d33.js';
33
+ import '@vitest/runner/utils';
34
+ import '@vitest/utils';
35
+ import 'node:fs/promises';
36
+ import 'source-map';
37
+ import 'module';
38
+ import 'acorn';
39
+ import 'acorn-walk';
40
+ import 'node:worker_threads';
41
+ import 'tinypool';
42
+ import './vendor-index.783e7f3e.js';
43
+ import 'perf_hooks';
44
+ import './chunk-utils-base.977ae74f.js';
45
+ import './chunk-utils-tasks.1b603032.js';
46
+ import 'crypto';
47
+ import 'vite-node/utils';
48
+ import '@vitest/utils/diff';
49
+ import 'node:crypto';
50
+ import './chunk-magic-string.3a794426.js';
51
+ import 'strip-literal';
52
+ import 'readline';
13
53
 
14
54
  var findUp$1 = {exports: {}};
15
55
 
@@ -207,7 +247,7 @@ var pLocate_1 = pLocate$1;
207
247
 
208
248
  const path$1 = k;
209
249
  const fs$1 = require$$0;
210
- const {promisify: promisify$1} = util;
250
+ const {promisify: promisify$1} = require$$0$1;
211
251
  const pLocate = pLocate_1;
212
252
 
213
253
  const fsStat = promisify$1(fs$1.stat);
@@ -276,7 +316,7 @@ locatePath.exports.sync = (paths, options) => {
276
316
  var pathExists = {exports: {}};
277
317
 
278
318
  const fs = require$$0;
279
- const {promisify} = util;
319
+ const {promisify} = require$$0$1;
280
320
 
281
321
  const pAccess = promisify(fs.access);
282
322
 
@@ -759,7 +799,7 @@ standard:"posix"};
759
799
  const SIGRTMIN=34;
760
800
  const SIGRTMAX=64;realtime.SIGRTMAX=SIGRTMAX;
761
801
 
762
- Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$1;
802
+ Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$2;
763
803
 
764
804
  var _core=core;
765
805
  var _realtime$1=realtime;
@@ -794,7 +834,7 @@ const number=supported?constantSignal:defaultNumber;
794
834
  return {name,number,description,supported,action,forced,standard};
795
835
  };
796
836
 
797
- Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$1;
837
+ Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$2;
798
838
 
799
839
  var _signals=signals;
800
840
  var _realtime=realtime;
@@ -1007,7 +1047,7 @@ stdio.exports.node = options => {
1007
1047
  return [...stdio, 'ipc'];
1008
1048
  };
1009
1049
 
1010
- const os = require$$0$1;
1050
+ const os = require$$0$2;
1011
1051
  const onExit = signalExit.exports;
1012
1052
 
1013
1053
  const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
@@ -1342,7 +1382,7 @@ var command = {
1342
1382
  };
1343
1383
 
1344
1384
  const path = k;
1345
- const childProcess = require$$0$2;
1385
+ const childProcess = require$$0$3;
1346
1386
  const crossSpawn = crossSpawn$1.exports;
1347
1387
  const stripFinalNewline = stripFinalNewline$1;
1348
1388
  const npmRunPath = npmRunPath$1.exports;
@@ -1,6 +1,35 @@
1
- import util$2 from 'util';
1
+ import { importModule } from 'local-pkg';
2
+ import require$$0 from 'util';
2
3
  import k from 'path';
3
4
 
5
+ const CoverageProviderMap = {
6
+ c8: "@vitest/coverage-c8",
7
+ istanbul: "@vitest/coverage-istanbul"
8
+ };
9
+ async function resolveCoverageProvider(provider) {
10
+ if (typeof provider === "string") {
11
+ const pkg = CoverageProviderMap[provider];
12
+ if (!pkg)
13
+ throw new Error(`Unknown coverage provider: ${provider}`);
14
+ return await importModule(pkg);
15
+ } else {
16
+ return provider;
17
+ }
18
+ }
19
+ async function getCoverageProvider(options) {
20
+ if ((options == null ? void 0 : options.enabled) && (options == null ? void 0 : options.provider)) {
21
+ const { getProvider } = await resolveCoverageProvider(options.provider);
22
+ return await getProvider();
23
+ }
24
+ return null;
25
+ }
26
+ async function takeCoverageInsideWorker(options) {
27
+ if (options.enabled && options.provider) {
28
+ const { takeCoverage } = await resolveCoverageProvider(options.provider);
29
+ return await (takeCoverage == null ? void 0 : takeCoverage());
30
+ }
31
+ }
32
+
4
33
  var utils$8 = {};
5
34
 
6
35
  (function (exports) {
@@ -458,7 +487,7 @@ var toRegexRange_1 = toRegexRange$1;
458
487
  * Licensed under the MIT License.
459
488
  */
460
489
 
461
- const util$1 = util$2;
490
+ const util$1 = require$$0;
462
491
  const toRegexRange = toRegexRange_1;
463
492
 
464
493
  const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
@@ -3495,7 +3524,7 @@ var picomatch_1 = picomatch$1;
3495
3524
  module.exports = picomatch_1;
3496
3525
  } (picomatch$2));
3497
3526
 
3498
- const util = util$2;
3527
+ const util = require$$0;
3499
3528
  const braces = braces_1;
3500
3529
  const picomatch = picomatch$2.exports;
3501
3530
  const utils = utils$4;
@@ -3961,4 +3990,4 @@ micromatch.braceExpand = (pattern, options) => {
3961
3990
 
3962
3991
  var micromatch_1 = micromatch;
3963
3992
 
3964
- export { micromatch_1 as m };
3993
+ export { CoverageProviderMap as C, getCoverageProvider as g, micromatch_1 as m, takeCoverageInsideWorker as t };
@@ -0,0 +1,29 @@
1
+ import { g as globalApis } from './chunk-constants.797d3ebf.js';
2
+ import { i as index } from './chunk-integrations-utils.f1f6f1ed.js';
3
+ import 'node:url';
4
+ import 'pathe';
5
+ import './chunk-utils-env.860d90c2.js';
6
+ import 'std-env';
7
+ import '@vitest/runner';
8
+ import './chunk-utils-import.9911c99d.js';
9
+ import '@vitest/runner/utils';
10
+ import '@vitest/utils';
11
+ import './chunk-utils-global.442d1d33.js';
12
+ import 'chai';
13
+ import './vendor-_commonjsHelpers.addc3445.js';
14
+ import '@vitest/expect';
15
+ import './chunk-runtime-rpc.9c0386cc.js';
16
+ import './chunk-snapshot-env.6457638e.js';
17
+ import './chunk-utils-base.977ae74f.js';
18
+ import './chunk-utils-tasks.1b603032.js';
19
+ import 'util';
20
+ import '@vitest/spy';
21
+ import './chunk-integrations-run-once.38756e30.js';
22
+
23
+ function registerApiGlobally() {
24
+ globalApis.forEach((api) => {
25
+ globalThis[api] = index[api];
26
+ });
27
+ }
28
+
29
+ export { registerApiGlobally };
@@ -0,0 +1,27 @@
1
+ import { g as getWorkerState } from './chunk-utils-global.442d1d33.js';
2
+
3
+ const filesCount = /* @__PURE__ */ new Map();
4
+ const cache = /* @__PURE__ */ new Map();
5
+ function runOnce(fn, key) {
6
+ const filepath = getWorkerState().filepath || "__unknown_files__";
7
+ if (!key) {
8
+ filesCount.set(filepath, (filesCount.get(filepath) || 0) + 1);
9
+ key = String(filesCount.get(filepath));
10
+ }
11
+ const id = `${filepath}:${key}`;
12
+ if (!cache.has(id))
13
+ cache.set(id, fn());
14
+ return cache.get(id);
15
+ }
16
+ function isFirstRun() {
17
+ let firstRun = false;
18
+ runOnce(() => {
19
+ firstRun = true;
20
+ }, "__vitest_first_run__");
21
+ return firstRun;
22
+ }
23
+ function resetRunOnceCounter() {
24
+ filesCount.clear();
25
+ }
26
+
27
+ export { resetRunOnceCounter as a, isFirstRun as i, runOnce as r };
@@ -0,0 +1,118 @@
1
+ import { suite, test, describe, it, beforeAll, beforeEach, afterAll, afterEach, onTestFailed } from '@vitest/runner';
2
+ import { b as bench, c as createExpect, g as globalExpect, v as vitest, a as vi } from './chunk-utils-import.9911c99d.js';
3
+ import { r as runOnce, i as isFirstRun } from './chunk-integrations-run-once.38756e30.js';
4
+ import * as chai from 'chai';
5
+ import { assert, should } from 'chai';
6
+
7
+ function getRunningMode() {
8
+ return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
9
+ }
10
+ function isWatchMode() {
11
+ return getRunningMode() === "watch";
12
+ }
13
+
14
+ var dist = {};
15
+
16
+ (function (exports) {
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.expectTypeOf = void 0;
19
+ const fn = () => true;
20
+ /**
21
+ * Similar to Jest's `expect`, but with type-awareness.
22
+ * Gives you access to a number of type-matchers that let you make assertions about the
23
+ * form of a reference or generic type parameter.
24
+ *
25
+ * @example
26
+ * import {foo, bar} from '../foo'
27
+ * import {expectTypeOf} from 'expect-type'
28
+ *
29
+ * test('foo types', () => {
30
+ * // make sure `foo` has type {a: number}
31
+ * expectTypeOf(foo).toMatchTypeOf({a: 1})
32
+ * expectTypeOf(foo).toHaveProperty('a').toBeNumber()
33
+ *
34
+ * // make sure `bar` is a function taking a string:
35
+ * expectTypeOf(bar).parameter(0).toBeString()
36
+ * expectTypeOf(bar).returns.not.toBeAny()
37
+ * })
38
+ *
39
+ * @description
40
+ * See the [full docs](https://npmjs.com/package/expect-type#documentation) for lots more examples.
41
+ */
42
+ const expectTypeOf = (_actual) => {
43
+ const nonFunctionProperties = [
44
+ 'parameters',
45
+ 'returns',
46
+ 'resolves',
47
+ 'not',
48
+ 'items',
49
+ 'constructorParameters',
50
+ 'instance',
51
+ 'guards',
52
+ 'asserts',
53
+ ];
54
+ const obj = {
55
+ /* eslint-disable mmkal/@typescript-eslint/no-unsafe-assignment */
56
+ toBeAny: fn,
57
+ toBeUnknown: fn,
58
+ toBeNever: fn,
59
+ toBeFunction: fn,
60
+ toBeObject: fn,
61
+ toBeArray: fn,
62
+ toBeString: fn,
63
+ toBeNumber: fn,
64
+ toBeBoolean: fn,
65
+ toBeVoid: fn,
66
+ toBeSymbol: fn,
67
+ toBeNull: fn,
68
+ toBeUndefined: fn,
69
+ toBeNullable: fn,
70
+ toMatchTypeOf: fn,
71
+ toEqualTypeOf: fn,
72
+ toBeCallableWith: fn,
73
+ toBeConstructibleWith: fn,
74
+ /* eslint-enable mmkal/@typescript-eslint/no-unsafe-assignment */
75
+ extract: exports.expectTypeOf,
76
+ exclude: exports.expectTypeOf,
77
+ toHaveProperty: exports.expectTypeOf,
78
+ parameter: exports.expectTypeOf,
79
+ };
80
+ const getterProperties = nonFunctionProperties;
81
+ getterProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => (0, exports.expectTypeOf)({}) }));
82
+ return obj;
83
+ };
84
+ exports.expectTypeOf = expectTypeOf;
85
+ } (dist));
86
+
87
+ const noop = () => {
88
+ };
89
+ const assertType = noop;
90
+
91
+ var index = /*#__PURE__*/Object.freeze({
92
+ __proto__: null,
93
+ suite: suite,
94
+ test: test,
95
+ describe: describe,
96
+ it: it,
97
+ beforeAll: beforeAll,
98
+ beforeEach: beforeEach,
99
+ afterAll: afterAll,
100
+ afterEach: afterEach,
101
+ onTestFailed: onTestFailed,
102
+ bench: bench,
103
+ runOnce: runOnce,
104
+ isFirstRun: isFirstRun,
105
+ assert: assert,
106
+ should: should,
107
+ createExpect: createExpect,
108
+ chai: chai,
109
+ expect: globalExpect,
110
+ vitest: vitest,
111
+ vi: vi,
112
+ getRunningMode: getRunningMode,
113
+ isWatchMode: isWatchMode,
114
+ expectTypeOf: dist.expectTypeOf,
115
+ assertType: assertType
116
+ });
117
+
118
+ export { isWatchMode as a, assertType as b, dist as d, getRunningMode as g, index as i };