@depup/vitest 4.0.18-depup.0

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 (111) hide show
  1. package/LICENSE.md +691 -0
  2. package/README.md +7 -0
  3. package/browser/context.d.ts +7 -0
  4. package/browser/context.js +20 -0
  5. package/config.d.ts +3 -0
  6. package/coverage.d.ts +1 -0
  7. package/dist/browser.d.ts +46 -0
  8. package/dist/browser.js +20 -0
  9. package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
  10. package/dist/chunks/base.CJ0Y4ePK.js +165 -0
  11. package/dist/chunks/benchmark.B3N2zMcH.js +40 -0
  12. package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +24 -0
  13. package/dist/chunks/browser.d.ChKACdzH.d.ts +59 -0
  14. package/dist/chunks/cac.DVeoLl0M.js +1409 -0
  15. package/dist/chunks/cli-api.B7PN_QUv.js +13657 -0
  16. package/dist/chunks/config.d.Cy95HiCx.d.ts +210 -0
  17. package/dist/chunks/console.Cf-YriPC.js +146 -0
  18. package/dist/chunks/constants.D_Q9UYh-.js +36 -0
  19. package/dist/chunks/coverage.AVPTjMgw.js +3292 -0
  20. package/dist/chunks/coverage.D_JHT54q.js +25 -0
  21. package/dist/chunks/coverage.d.BZtK59WP.d.ts +37 -0
  22. package/dist/chunks/creator.DAmOKTvJ.js +673 -0
  23. package/dist/chunks/date.Bq6ZW5rf.js +73 -0
  24. package/dist/chunks/defaults.BOqNVLsY.js +74 -0
  25. package/dist/chunks/env.D4Lgay0q.js +8 -0
  26. package/dist/chunks/environment.d.CrsxCzP1.d.ts +29 -0
  27. package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
  28. package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
  29. package/dist/chunks/git.Bm2pzPAa.js +71 -0
  30. package/dist/chunks/global.d.B15mdLcR.d.ts +99 -0
  31. package/dist/chunks/globals.DOayXfHP.js +30 -0
  32. package/dist/chunks/index.6Qv1eEA6.js +109 -0
  33. package/dist/chunks/index.C5r1PdPD.js +231 -0
  34. package/dist/chunks/index.Chj8NDwU.js +206 -0
  35. package/dist/chunks/index.CyBMJtT7.js +727 -0
  36. package/dist/chunks/index.D3XRDfWc.js +213 -0
  37. package/dist/chunks/index.D4KonVSU.js +6343 -0
  38. package/dist/chunks/index.M8mOzt4Y.js +3839 -0
  39. package/dist/chunks/index.Z5E_ObnR.js +37 -0
  40. package/dist/chunks/init-forks._y3TW739.js +41 -0
  41. package/dist/chunks/init-threads.DBO2kn-p.js +18 -0
  42. package/dist/chunks/init.B6MLFIaN.js +334 -0
  43. package/dist/chunks/inspector.CvyFGlXm.js +53 -0
  44. package/dist/chunks/modules.BJuCwlRJ.js +36 -0
  45. package/dist/chunks/node.Ce0vMQM7.js +14 -0
  46. package/dist/chunks/plugin.d.CtqpEehP.d.ts +38 -0
  47. package/dist/chunks/reporters.d.CWXNI2jG.d.ts +3271 -0
  48. package/dist/chunks/rpc.BoxB0q7B.js +76 -0
  49. package/dist/chunks/rpc.d.RH3apGEf.d.ts +64 -0
  50. package/dist/chunks/setup-common.Cm-kSBVi.js +60 -0
  51. package/dist/chunks/startModuleRunner.DEj0jb3e.js +861 -0
  52. package/dist/chunks/suite.d.BJWk38HB.d.ts +10 -0
  53. package/dist/chunks/test.B8ej_ZHS.js +254 -0
  54. package/dist/chunks/traces.CCmnQaNT.js +217 -0
  55. package/dist/chunks/traces.d.402V_yFI.d.ts +18 -0
  56. package/dist/chunks/utils.DvEY5TfP.js +52 -0
  57. package/dist/chunks/vi.2VT5v0um.js +3919 -0
  58. package/dist/chunks/vm.D3epNOPZ.js +744 -0
  59. package/dist/chunks/worker.d.Dyxm8DEL.d.ts +255 -0
  60. package/dist/cli.js +28 -0
  61. package/dist/config.cjs +94 -0
  62. package/dist/config.d.ts +104 -0
  63. package/dist/config.js +15 -0
  64. package/dist/coverage.d.ts +118 -0
  65. package/dist/coverage.js +23 -0
  66. package/dist/environments.d.ts +22 -0
  67. package/dist/environments.js +3 -0
  68. package/dist/index.d.ts +510 -0
  69. package/dist/index.js +20 -0
  70. package/dist/mocker.d.ts +1 -0
  71. package/dist/mocker.js +1 -0
  72. package/dist/module-evaluator.d.ts +124 -0
  73. package/dist/module-evaluator.js +343 -0
  74. package/dist/module-runner.js +17 -0
  75. package/dist/node.d.ts +251 -0
  76. package/dist/node.js +98 -0
  77. package/dist/path.js +7 -0
  78. package/dist/reporters.d.ts +27 -0
  79. package/dist/reporters.js +24 -0
  80. package/dist/runners.d.ts +50 -0
  81. package/dist/runners.js +19 -0
  82. package/dist/snapshot.d.ts +9 -0
  83. package/dist/snapshot.js +4 -0
  84. package/dist/spy.js +1 -0
  85. package/dist/suite.d.ts +5 -0
  86. package/dist/suite.js +6 -0
  87. package/dist/worker.d.ts +32 -0
  88. package/dist/worker.js +48 -0
  89. package/dist/workers/forks.js +54 -0
  90. package/dist/workers/runVmTests.js +95 -0
  91. package/dist/workers/threads.js +55 -0
  92. package/dist/workers/vmForks.js +36 -0
  93. package/dist/workers/vmThreads.js +37 -0
  94. package/environments.d.ts +1 -0
  95. package/globals.d.ts +20 -0
  96. package/import-meta.d.ts +5 -0
  97. package/importMeta.d.ts +4 -0
  98. package/index.cjs +5 -0
  99. package/index.d.cts +1 -0
  100. package/jsdom.d.ts +6 -0
  101. package/mocker.d.ts +1 -0
  102. package/node.d.ts +1 -0
  103. package/optional-types.d.ts +7 -0
  104. package/package.json +224 -0
  105. package/reporters.d.ts +1 -0
  106. package/runners.d.ts +1 -0
  107. package/snapshot.d.ts +1 -0
  108. package/suite.d.ts +1 -0
  109. package/suppress-warnings.cjs +21 -0
  110. package/vitest.mjs +2 -0
  111. package/worker.d.ts +1 -0
@@ -0,0 +1,25 @@
1
+ const CoverageProviderMap = {
2
+ v8: "@vitest/coverage-v8",
3
+ istanbul: "@vitest/coverage-istanbul"
4
+ };
5
+ async function resolveCoverageProviderModule(options, loader) {
6
+ if (!options?.enabled || !options.provider) return null;
7
+ const provider = options.provider;
8
+ if (provider === "v8" || provider === "istanbul") {
9
+ let builtInModule = CoverageProviderMap[provider];
10
+ if (provider === "v8" && loader.isBrowser) builtInModule += "/browser";
11
+ const { default: coverageModule } = await loader.import(builtInModule);
12
+ if (!coverageModule) throw new Error(`Failed to load ${CoverageProviderMap[provider]}. Default export is missing.`);
13
+ return coverageModule;
14
+ }
15
+ let customProviderModule;
16
+ try {
17
+ customProviderModule = await loader.import(options.customProviderModule);
18
+ } catch (error) {
19
+ throw new Error(`Failed to load custom CoverageProviderModule from ${options.customProviderModule}`, { cause: error });
20
+ }
21
+ if (customProviderModule.default == null) throw new Error(`Custom CoverageProviderModule loaded from ${options.customProviderModule} was not the default export`);
22
+ return customProviderModule.default;
23
+ }
24
+
25
+ export { CoverageProviderMap as C, resolveCoverageProviderModule as r };
@@ -0,0 +1,37 @@
1
+ interface RuntimeCoverageModuleLoader {
2
+ import: (id: string) => Promise<{
3
+ default: RuntimeCoverageProviderModule;
4
+ }>;
5
+ isBrowser?: boolean;
6
+ moduleExecutionInfo?: Map<string, {
7
+ startOffset: number;
8
+ }>;
9
+ }
10
+ interface RuntimeCoverageProviderModule {
11
+ /**
12
+ * Factory for creating a new coverage provider
13
+ */
14
+ getProvider: () => any;
15
+ /**
16
+ * Executed before tests are run in the worker thread.
17
+ */
18
+ startCoverage?: (runtimeOptions: {
19
+ isolate: boolean;
20
+ }) => unknown | Promise<unknown>;
21
+ /**
22
+ * Executed on after each run in the worker thread. Possible to return a payload passed to the provider
23
+ */
24
+ takeCoverage?: (runtimeOptions?: {
25
+ moduleExecutionInfo?: Map<string, {
26
+ startOffset: number;
27
+ }>;
28
+ }) => unknown | Promise<unknown>;
29
+ /**
30
+ * Executed after all tests have been run in the worker thread.
31
+ */
32
+ stopCoverage?: (runtimeOptions: {
33
+ isolate: boolean;
34
+ }) => unknown | Promise<unknown>;
35
+ }
36
+
37
+ export type { RuntimeCoverageModuleLoader as R, RuntimeCoverageProviderModule as a };