@voidzero-dev/vite-plus-test 0.1.8 → 0.1.10

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 (205) hide show
  1. package/LICENSE.md +181 -1
  2. package/dist/@vitest/browser/client/.vite/manifest.json +6 -6
  3. package/dist/@vitest/browser/client/__vitest__/assets/index-Da0hb3oU.css +1 -0
  4. package/dist/@vitest/browser/client/__vitest__/assets/index-Di71CKDo.js +63 -0
  5. package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
  6. package/dist/@vitest/browser/client/__vitest__/favicon.svg +49 -4
  7. package/dist/@vitest/browser/client/__vitest__/index.html +2 -2
  8. package/dist/@vitest/browser/client/__vitest_browser__/{orchestrator-S_3e_uzt.js → orchestrator-CXs6qrFe.js} +70 -28
  9. package/dist/@vitest/browser/client/__vitest_browser__/{tester-k74mgIRa.js → tester-K5NNxh1O.js} +167 -58
  10. package/dist/@vitest/browser/client/__vitest_browser__/{utils-uxqdqUz8.js → utils-C2ISqq1C.js} +2 -2
  11. package/dist/@vitest/browser/client/favicon.svg +49 -4
  12. package/dist/@vitest/browser/client/orchestrator.html +2 -2
  13. package/dist/@vitest/browser/client/tester/tester.html +2 -2
  14. package/dist/@vitest/browser/client.js +20 -13
  15. package/dist/@vitest/browser/context.d.ts +160 -10
  16. package/dist/@vitest/browser/context.js +108 -22
  17. package/dist/@vitest/browser/expect-element.js +23 -28
  18. package/dist/@vitest/browser/index-5Pe7X7sp.js +7 -0
  19. package/dist/@vitest/browser/index.d.ts +20 -2
  20. package/dist/@vitest/browser/index.js +5706 -159
  21. package/dist/@vitest/browser/locators.d.ts +14 -3
  22. package/dist/@vitest/browser/locators.js +1 -1
  23. package/dist/@vitest/browser-playwright/index.d.ts +22 -5
  24. package/dist/@vitest/browser-playwright/index.js +169 -61
  25. package/dist/@vitest/browser-preview/index.d.ts +14 -1
  26. package/dist/@vitest/browser-preview/locators.js +31 -18
  27. package/dist/@vitest/browser-webdriverio/index.d.ts +17 -3
  28. package/dist/@vitest/browser-webdriverio/index.js +22 -2
  29. package/dist/@vitest/browser-webdriverio/locators.js +84 -7
  30. package/dist/@vitest/expect/index.d.ts +172 -54
  31. package/dist/@vitest/expect/index.js +124 -67
  32. package/dist/@vitest/mocker/auto-register.js +1 -0
  33. package/dist/@vitest/mocker/automock.d.ts +1 -0
  34. package/dist/@vitest/mocker/automock.js +5 -0
  35. package/dist/@vitest/mocker/browser.d.ts +4 -4
  36. package/dist/@vitest/mocker/browser.js +1 -0
  37. package/dist/@vitest/mocker/chunk-automock.js +182 -14
  38. package/dist/@vitest/mocker/chunk-helpers.js +44 -0
  39. package/dist/@vitest/mocker/chunk-hoistMocks.js +659 -0
  40. package/dist/@vitest/mocker/chunk-mocker.js +41 -30
  41. package/dist/@vitest/mocker/chunk-registry.js +21 -7
  42. package/dist/@vitest/mocker/chunk-utils.js +18 -7
  43. package/dist/@vitest/mocker/hoistMocks.d-w2ILr1dG.d.ts +739 -0
  44. package/dist/@vitest/mocker/{index.d-C-sLYZi-.d.ts → index.d-B41z0AuW.d.ts} +1 -1
  45. package/dist/@vitest/mocker/index.d.ts +2 -2
  46. package/dist/@vitest/mocker/index.js +18 -3
  47. package/dist/@vitest/mocker/{mocker.d-TnKRhz7N.d.ts → mocker.d-QEntlm6J.d.ts} +10 -5
  48. package/dist/@vitest/mocker/node.d.ts +5 -734
  49. package/dist/@vitest/mocker/node.js +29 -587
  50. package/dist/@vitest/mocker/redirect.js +4 -4
  51. package/dist/@vitest/mocker/register.d.ts +3 -3
  52. package/dist/@vitest/mocker/register.js +1 -0
  53. package/dist/@vitest/mocker/transforms.d.ts +6 -0
  54. package/dist/@vitest/mocker/transforms.js +8 -0
  55. package/dist/@vitest/mocker/{types.d-B8CCKmHt.d.ts → types.d-BjI5eAwu.d.ts} +23 -7
  56. package/dist/@vitest/pretty-format/index.d.ts +11 -1
  57. package/dist/@vitest/pretty-format/index.js +33 -4
  58. package/dist/@vitest/runner/chunk-tasks.js +305 -37
  59. package/dist/@vitest/runner/index.d.ts +5 -6
  60. package/dist/@vitest/runner/index.js +1146 -455
  61. package/dist/@vitest/runner/{tasks.d-C7UxawJ9.d.ts → tasks.d-D2GKpdwQ.d.ts} +726 -55
  62. package/dist/@vitest/runner/types.d.ts +2 -182
  63. package/dist/@vitest/runner/utils.d.ts +16 -8
  64. package/dist/@vitest/runner/utils.js +1 -1
  65. package/dist/@vitest/snapshot/{environment.d-DHdQ1Csl.d.ts → environment.d-DOJxxZV9.d.ts} +2 -7
  66. package/dist/@vitest/snapshot/environment.d.ts +2 -1
  67. package/dist/@vitest/snapshot/environment.js +1 -1
  68. package/dist/@vitest/snapshot/index.d.ts +4 -3
  69. package/dist/@vitest/snapshot/index.js +21 -550
  70. package/dist/@vitest/snapshot/manager.d.ts +3 -2
  71. package/dist/@vitest/snapshot/manager.js +1 -1
  72. package/dist/@vitest/snapshot/{rawSnapshot.d-lFsMJFUd.d.ts → rawSnapshot.d-U2kJUxDr.d.ts} +1 -1
  73. package/dist/@vitest/spy/index.d.ts +34 -4
  74. package/dist/@vitest/spy/index.js +69 -19
  75. package/dist/@vitest/utils/diff.js +11 -9
  76. package/dist/@vitest/utils/display.d.ts +2 -1
  77. package/dist/@vitest/utils/display.js +38 -5
  78. package/dist/@vitest/utils/error.d.ts +2 -1
  79. package/dist/@vitest/utils/error.js +1 -2
  80. package/dist/@vitest/utils/helpers.d.ts +4 -1
  81. package/dist/@vitest/utils/helpers.js +43 -1
  82. package/dist/@vitest/utils/resolver.js +1 -2
  83. package/dist/@vitest/utils/serialize.js +6 -6
  84. package/dist/@vitest/utils/source-map/node.d.ts +6 -0
  85. package/dist/@vitest/utils/source-map/node.js +23 -0
  86. package/dist/@vitest/utils/source-map.js +15 -5
  87. package/dist/browser.d.ts +3 -2
  88. package/dist/browser.js +2 -2
  89. package/dist/chunks/acorn.B2iPLyUM.js +5958 -0
  90. package/dist/chunks/{base.CJ0Y4ePK.js → base.DM0-RqVb.js} +54 -16
  91. package/dist/chunks/{benchmark.B3N2zMcH.js → benchmark.D0SlKNbZ.js} +1 -1
  92. package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.X3SXoOCV.d.ts} +4 -1
  93. package/dist/chunks/{cac.DVeoLl0M.js → cac.CWGDZnXT.js} +979 -20
  94. package/dist/chunks/{cli-api.B7PN_QUv.js → cli-api.DuT9iuvY.js} +8764 -7898
  95. package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.EJLVE3es.d.ts} +30 -15
  96. package/dist/chunks/{console.Cf-YriPC.js → console.3WNpx0tS.js} +3 -2
  97. package/dist/chunks/{constants.D_Q9UYh-.js → constants.CPYnjOGj.js} +4 -2
  98. package/dist/chunks/coverage.Bri33R1t.js +1050 -0
  99. package/dist/chunks/{creator.DAmOKTvJ.js → creator.DgVhQm5q.js} +35 -4
  100. package/dist/chunks/{defaults.BOqNVLsY.js → defaults.CdU2lD-q.js} +4 -3
  101. package/dist/chunks/{global.d.B15mdLcR.d.ts → global.d.x-ILCfAE.d.ts} +1 -2
  102. package/dist/chunks/{globals.DOayXfHP.js → globals.BXNGLnTL.js} +11 -10
  103. package/dist/chunks/{coverage.AVPTjMgw.js → index.BCY_7LL2.js} +5 -959
  104. package/dist/chunks/{index.C5r1PdPD.js → index.CEzQDJGb.js} +1 -1
  105. package/dist/chunks/{index.D3XRDfWc.js → index.CMESou6r.js} +26 -1
  106. package/dist/chunks/{index.6Qv1eEA6.js → index.DGNSnENe.js} +95 -9
  107. package/dist/chunks/{index.M8mOzt4Y.js → index.DXMFO5MJ.js} +3279 -2914
  108. package/dist/chunks/{index.Z5E_ObnR.js → index.DlDSLQD3.js} +7 -3
  109. package/dist/chunks/{index.CyBMJtT7.js → index.EY6TCHpo.js} +10 -8
  110. package/dist/chunks/{index.D4KonVSU.js → index.og1WyBLx.js} +18 -3
  111. package/dist/chunks/{init-forks._y3TW739.js → init-forks.DeArv0jT.js} +1 -1
  112. package/dist/chunks/{init-threads.DBO2kn-p.js → init-threads.-2OUl4Nn.js} +1 -1
  113. package/dist/chunks/{init.B6MLFIaN.js → init.DICorXCo.js} +52 -13
  114. package/dist/chunks/native.DPzPHdi5.js +148 -0
  115. package/dist/chunks/nativeModuleMocker.DndvSdL6.js +206 -0
  116. package/dist/chunks/nativeModuleRunner.BIakptoF.js +36 -0
  117. package/dist/chunks/{node.Ce0vMQM7.js → node.COQbm6gK.js} +1 -1
  118. package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.BuW-flqo.d.ts} +1 -1
  119. package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.DVUYHHhe.d.ts} +328 -79
  120. package/dist/chunks/rpc.MzXet3jl.js +144 -0
  121. package/dist/chunks/{rpc.d.RH3apGEf.d.ts → rpc.d.BFMWpdph.d.ts} +10 -2
  122. package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.B41N_kPE.js} +3 -3
  123. package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startVitestModuleRunner.C3ZR-4J3.js} +265 -405
  124. package/dist/chunks/{suite.d.BJWk38HB.d.ts → suite.d.udJtyAgw.d.ts} +1 -1
  125. package/dist/chunks/{vi.2VT5v0um.js → test.CTcmp4Su.js} +538 -181
  126. package/dist/chunks/{utils.DvEY5TfP.js → utils.BX5Fg8C4.js} +8 -1
  127. package/dist/chunks/{vm.D3epNOPZ.js → vm.Dh2rTtmP.js} +48 -8
  128. package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.B84sVRy0.d.ts} +2 -2
  129. package/dist/cli.js +6 -5
  130. package/dist/client/.vite/manifest.json +6 -6
  131. package/dist/client/__vitest__/assets/index-Da0hb3oU.css +1 -0
  132. package/dist/client/__vitest__/assets/index-Di71CKDo.js +63 -0
  133. package/dist/client/__vitest__/favicon.ico +0 -0
  134. package/dist/client/__vitest__/favicon.svg +49 -4
  135. package/dist/client/__vitest__/index.html +2 -2
  136. package/dist/client/__vitest_browser__/{orchestrator-S_3e_uzt.js → orchestrator-CXs6qrFe.js} +70 -28
  137. package/dist/client/__vitest_browser__/{tester-k74mgIRa.js → tester-K5NNxh1O.js} +167 -58
  138. package/dist/client/__vitest_browser__/{utils-uxqdqUz8.js → utils-C2ISqq1C.js} +2 -2
  139. package/dist/client/favicon.svg +49 -4
  140. package/dist/client/orchestrator.html +2 -2
  141. package/dist/client/tester/tester.html +2 -2
  142. package/dist/client.js +20 -13
  143. package/dist/config.cjs +3 -2
  144. package/dist/config.d.ts +13 -12
  145. package/dist/config.js +2 -2
  146. package/dist/context.js +108 -22
  147. package/dist/coverage.d.ts +12 -8
  148. package/dist/coverage.js +8 -5
  149. package/dist/environments.js +3 -1
  150. package/dist/expect-element.js +23 -23
  151. package/dist/index-5Pe7X7sp.js +7 -0
  152. package/dist/index.d.ts +66 -27
  153. package/dist/index.js +10 -9
  154. package/dist/locators.d.ts +14 -3
  155. package/dist/locators.js +1 -1
  156. package/dist/module-evaluator.d.ts +11 -1
  157. package/dist/module-evaluator.js +43 -26
  158. package/dist/node.d.ts +28 -14
  159. package/dist/node.js +42 -40
  160. package/dist/nodejs-worker-loader.js +41 -0
  161. package/dist/plugins/mocker-transforms.mjs +2 -0
  162. package/dist/plugins/utils-source-map-node.mjs +2 -0
  163. package/dist/reporters.d.ts +8 -8
  164. package/dist/reporters.js +7 -5
  165. package/dist/runners.d.ts +24 -5
  166. package/dist/runners.js +6 -6
  167. package/dist/runtime.d.ts +6 -0
  168. package/dist/runtime.js +35 -0
  169. package/dist/snapshot.js +4 -2
  170. package/dist/suite.d.ts +1 -1
  171. package/dist/suite.js +4 -2
  172. package/dist/vendor/blazediff_core.d.mts +1 -0
  173. package/dist/vendor/blazediff_core.mjs +117 -0
  174. package/dist/vendor/chai.mjs +4 -249
  175. package/dist/vendor/convert-source-map.d.mts +1 -0
  176. package/dist/vendor/convert-source-map.mjs +150 -0
  177. package/dist/vendor/expect-type.d.mts +14 -7
  178. package/dist/vendor/expect-type.mjs +5 -5
  179. package/dist/vendor/std-env.d.mts +131 -40
  180. package/dist/vendor/std-env.mjs +114 -117
  181. package/dist/worker.d.ts +6 -6
  182. package/dist/worker.js +27 -21
  183. package/dist/workers/forks.js +23 -17
  184. package/dist/workers/runVmTests.js +18 -16
  185. package/dist/workers/threads.js +23 -17
  186. package/dist/workers/vmForks.js +15 -12
  187. package/dist/workers/vmThreads.js +15 -12
  188. package/globals.d.ts +2 -0
  189. package/package.json +36 -27
  190. package/suppress-warnings.cjs +1 -0
  191. package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +0 -57
  192. package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +0 -1
  193. package/dist/@vitest/browser/index-D6m36C6U.js +0 -11
  194. package/dist/@vitest/utils/chunk-_commonjsHelpers.js +0 -5
  195. package/dist/@vitest/utils/highlight.d.ts +0 -9
  196. package/dist/@vitest/utils/highlight.js +0 -538
  197. package/dist/chunks/date.Bq6ZW5rf.js +0 -73
  198. package/dist/chunks/rpc.BoxB0q7B.js +0 -76
  199. package/dist/chunks/test.B8ej_ZHS.js +0 -254
  200. package/dist/client/__vitest__/assets/index-BUCFJtth.js +0 -57
  201. package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +0 -1
  202. package/dist/index-D6m36C6U.js +0 -6
  203. package/dist/mocker.d.ts +0 -1
  204. package/dist/mocker.js +0 -1
  205. package/dist/module-runner.js +0 -17
@@ -1,183 +1,3 @@
1
- import { DiffOptions } from '../utils/diff.js';
2
- import { F as File, a as Test, S as Suite, M as TaskResultPack, G as TaskEventPack, P as TestAnnotation, b as TestArtifact, Z as TestContext, I as ImportDuration, x as SequenceHooks, y as SequenceSetupFiles } from './tasks.d-C7UxawJ9.js';
3
- export { A as AfterAllListener, n as AfterEachListener, B as BeforeAllListener, p as BeforeEachListener, q as Fixture, r as FixtureFn, s as FixtureOptions, t as Fixtures, u as InferFixturesTypes, O as OnTestFailedHandler, v as OnTestFinishedHandler, R as RunMode, w as RuntimeContext, g as SuiteAPI, h as SuiteCollector, z as SuiteFactory, d as SuiteHooks, T as Task, D as TaskBase, E as TaskCustomOptions, H as TaskHook, J as TaskMeta, K as TaskPopulated, L as TaskResult, N as TaskState, e as TaskUpdateEvent, f as TestAPI, Q as TestAnnotationArtifact, U as TestAnnotationLocation, V as TestArtifactBase, W as TestArtifactLocation, X as TestArtifactRegistry, Y as TestAttachment, _ as TestFunction, $ as TestOptions, a0 as Use, a1 as VisualRegressionArtifact } from './tasks.d-C7UxawJ9.js';
1
+ export { A as AfterAllListener, i as AfterEachListener, j as AroundAllListener, k as AroundEachListener, B as BeforeAllListener, l as BeforeEachListener, C as CancelReason, m as FailureScreenshotArtifact, c as File, F as FileSpecification, n as Fixture, o as FixtureFn, p as FixtureOptions, q as Fixtures, I as ImportDuration, r as InferFixturesTypes, O as OnTestFailedHandler, s as OnTestFinishedHandler, R as Retry, t as RunMode, u as RuntimeContext, v as SequenceHooks, w as SequenceSetupFiles, x as SerializableRetry, S as Suite, g as SuiteAPI, h as SuiteCollector, y as SuiteFactory, b as SuiteHooks, z as SuiteOptions, e as Task, D as TaskBase, E as TaskCustomOptions, G as TaskEventPack, H as TaskHook, J as TaskMeta, K as TaskPopulated, L as TaskResult, M as TaskResultPack, N as TaskState, d as TaskUpdateEvent, a as Test, f as TestAPI, P as TestAnnotation, Q as TestAnnotationArtifact, U as TestAnnotationLocation, T as TestArtifact, W as TestArtifactBase, X as TestArtifactLocation, Y as TestArtifactRegistry, Z as TestAttachment, _ as TestContext, $ as TestFunction, a0 as TestOptions, a1 as TestTagDefinition, a2 as TestTags, a3 as Use, a4 as VisualRegressionArtifact, V as VitestRunner, a5 as VitestRunnerConfig, a6 as VitestRunnerConstructor, a7 as VitestRunnerImportSource } from './tasks.d-D2GKpdwQ.js';
4
2
  import '../utils/index.js';
5
-
6
- /**
7
- * This is a subset of Vitest config that's required for the runner to work.
8
- */
9
- interface VitestRunnerConfig {
10
- root: string;
11
- setupFiles: string[];
12
- name?: string;
13
- passWithNoTests: boolean;
14
- testNamePattern?: RegExp;
15
- allowOnly?: boolean;
16
- sequence: {
17
- shuffle?: boolean;
18
- concurrent?: boolean;
19
- seed: number;
20
- hooks: SequenceHooks;
21
- setupFiles: SequenceSetupFiles;
22
- };
23
- chaiConfig?: {
24
- truncateThreshold?: number;
25
- };
26
- maxConcurrency: number;
27
- testTimeout: number;
28
- hookTimeout: number;
29
- retry: number;
30
- includeTaskLocation?: boolean;
31
- diffOptions?: DiffOptions;
32
- }
33
- /**
34
- * Possible options to run a single file in a test.
35
- */
36
- interface FileSpecification {
37
- filepath: string;
38
- testLocations: number[] | undefined;
39
- }
40
- type VitestRunnerImportSource = "collect" | "setup";
41
- interface VitestRunnerConstructor {
42
- new (config: VitestRunnerConfig): VitestRunner;
43
- }
44
- type CancelReason = "keyboard-input" | "test-failure" | (string & Record<string, never>);
45
- interface VitestRunner {
46
- /**
47
- * First thing that's getting called before actually collecting and running tests.
48
- */
49
- onBeforeCollect?: (paths: string[]) => unknown;
50
- /**
51
- * Called after the file task was created but not collected yet.
52
- */
53
- onCollectStart?: (file: File) => unknown;
54
- /**
55
- * Called after collecting tests and before "onBeforeRun".
56
- */
57
- onCollected?: (files: File[]) => unknown;
58
- /**
59
- * Called when test runner should cancel next test runs.
60
- * Runner should listen for this method and mark tests and suites as skipped in
61
- * "onBeforeRunSuite" and "onBeforeRunTask" when called.
62
- */
63
- cancel?: (reason: CancelReason) => unknown;
64
- /**
65
- * Called before running a single test. Doesn't have "result" yet.
66
- */
67
- onBeforeRunTask?: (test: Test) => unknown;
68
- /**
69
- * Called before actually running the test function. Already has "result" with "state" and "startTime".
70
- */
71
- onBeforeTryTask?: (test: Test, options: {
72
- retry: number;
73
- repeats: number;
74
- }) => unknown;
75
- /**
76
- * When the task has finished running, but before cleanup hooks are called
77
- */
78
- onTaskFinished?: (test: Test) => unknown;
79
- /**
80
- * Called after result and state are set.
81
- */
82
- onAfterRunTask?: (test: Test) => unknown;
83
- /**
84
- * Called right after running the test function. Doesn't have new state yet. Will not be called, if the test function throws.
85
- */
86
- onAfterTryTask?: (test: Test, options: {
87
- retry: number;
88
- repeats: number;
89
- }) => unknown;
90
- /**
91
- * Called after the retry resolution happend. Unlike `onAfterTryTask`, the test now has a new state.
92
- * All `after` hooks were also called by this point.
93
- */
94
- onAfterRetryTask?: (test: Test, options: {
95
- retry: number;
96
- repeats: number;
97
- }) => unknown;
98
- /**
99
- * Called before running a single suite. Doesn't have "result" yet.
100
- */
101
- onBeforeRunSuite?: (suite: Suite) => unknown;
102
- /**
103
- * Called after running a single suite. Has state and result.
104
- */
105
- onAfterRunSuite?: (suite: Suite) => unknown;
106
- /**
107
- * If defined, will be called instead of usual Vitest suite partition and handling.
108
- * "before" and "after" hooks will not be ignored.
109
- */
110
- runSuite?: (suite: Suite) => Promise<void>;
111
- /**
112
- * If defined, will be called instead of usual Vitest handling. Useful, if you have your custom test function.
113
- * "before" and "after" hooks will not be ignored.
114
- */
115
- runTask?: (test: Test) => Promise<void>;
116
- /**
117
- * Called, when a task is updated. The same as "onTaskUpdate" in a reporter, but this is running in the same thread as tests.
118
- */
119
- onTaskUpdate?: (task: TaskResultPack[], events: TaskEventPack[]) => Promise<void>;
120
- /**
121
- * Called when annotation is added via the `context.annotate` method.
122
- */
123
- onTestAnnotate?: (test: Test, annotation: TestAnnotation) => Promise<TestAnnotation>;
124
- /**
125
- * @experimental
126
- *
127
- * Called when artifacts are recorded on tests via the `recordArtifact` utility.
128
- */
129
- onTestArtifactRecord?: <Artifact extends TestArtifact>(test: Test, artifact: Artifact) => Promise<Artifact>;
130
- /**
131
- * Called before running all tests in collected paths.
132
- */
133
- onBeforeRunFiles?: (files: File[]) => unknown;
134
- /**
135
- * Called right after running all tests in collected paths.
136
- */
137
- onAfterRunFiles?: (files: File[]) => unknown;
138
- /**
139
- * Called when new context for a test is defined. Useful if you want to add custom properties to the context.
140
- * If you only want to define custom context, consider using "beforeAll" in "setupFiles" instead.
141
- *
142
- * @see https://vitest.dev/advanced/runner#your-task-function
143
- */
144
- extendTaskContext?: (context: TestContext) => TestContext;
145
- /**
146
- * Called when test and setup files are imported. Can be called in two situations: when collecting tests and when importing setup files.
147
- */
148
- importFile: (filepath: string, source: VitestRunnerImportSource) => unknown;
149
- /**
150
- * Function that is called when the runner attempts to get the value when `test.extend` is used with `{ injected: true }`
151
- */
152
- injectValue?: (key: string) => unknown;
153
- /**
154
- * Gets the time spent importing each individual non-externalized file that Vitest collected.
155
- */
156
- getImportDurations?: () => Record<string, ImportDuration>;
157
- /**
158
- * Publicly available configuration.
159
- */
160
- config: VitestRunnerConfig;
161
- /**
162
- * The name of the current pool. Can affect how stack trace is inferred on the server side.
163
- */
164
- pool?: string;
165
- /**
166
- * The current Vite environment that processes the files on the server.
167
- */
168
- viteEnvironment?: string;
169
- /**
170
- * Return the worker context for fixtures specified with `scope: 'worker'`
171
- */
172
- getWorkerContext?: () => Record<string, unknown>;
173
- onCleanupWorkerContext?: (cleanup: () => unknown) => void;
174
- trace?<T>(name: string, cb: () => T): T;
175
- trace?<T>(name: string, attributes: Record<string, any>, cb: () => T): T;
176
- /** @private */
177
- _currentTaskStartTime?: number;
178
- /** @private */
179
- _currentTaskTimeout?: number;
180
- }
181
-
182
- export { File, ImportDuration, SequenceHooks, SequenceSetupFiles, Suite, TaskEventPack, TaskResultPack, Test, TestAnnotation, TestArtifact, TestContext };
183
- export type { CancelReason, FileSpecification, VitestRunner, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource };
3
+ import '../utils/diff.js';
@@ -1,11 +1,12 @@
1
- import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-C7UxawJ9.js';
2
- export { C as ChainableFunction, c as createChainable } from './tasks.d-C7UxawJ9.js';
1
+ import { S as Suite, c as File, e as Task, a1 as TestTagDefinition, a5 as VitestRunnerConfig, a as Test } from './tasks.d-D2GKpdwQ.js';
2
+ export { ag as ChainableFunction, ah as createChainable } from './tasks.d-D2GKpdwQ.js';
3
3
  import { ParsedStack, Arrayable } from '../utils/index.js';
4
+ import '../utils/diff.js';
4
5
 
5
6
  /**
6
7
  * If any tasks been marked as `only`, mark all other tasks as `skip`.
7
8
  */
8
- declare function interpretTaskModes(file: Suite, namePattern?: string | RegExp, testLocations?: number[] | undefined, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean): void;
9
+ declare function interpretTaskModes(file: Suite, namePattern?: string | RegExp, testLocations?: number[] | undefined, testIds?: string[] | undefined, testTagsFilter?: ((testTags: string[]) => boolean) | undefined, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean): void;
9
10
  declare function someTasksAreOnly(suite: Suite): boolean;
10
11
  declare function generateHash(str: string): string;
11
12
  declare function calculateSuiteHash(parent: Suite): void;
@@ -18,19 +19,26 @@ declare function createFileTask(filepath: string, root: string, projectName: str
18
19
  declare function generateFileHash(file: string, projectName: string | undefined): string;
19
20
  declare function findTestFileStackTrace(testFilePath: string, error: string): ParsedStack | undefined;
20
21
 
21
- /**
22
- * Return a function for running multiple async operations with limited concurrency.
23
- */
24
- declare function limitConcurrency(concurrency?: number): <
22
+ interface ConcurrencyLimiter extends ConcurrencyLimiterFn {
23
+ acquire: () => (() => void) | Promise<() => void>;
24
+ }
25
+ type ConcurrencyLimiterFn = <
25
26
  Args extends unknown[],
26
27
  T
27
28
  >(func: (...args: Args) => PromiseLike<T> | T, ...args: Args) => Promise<T>;
29
+ /**
30
+ * Return a function for running multiple async operations with limited concurrency.
31
+ */
32
+ declare function limitConcurrency(concurrency?: number): ConcurrencyLimiter;
28
33
 
29
34
  /**
30
35
  * Partition in tasks groups by consecutive concurrent
31
36
  */
32
37
  declare function partitionSuiteChildren(suite: Suite): Task[][];
33
38
 
39
+ declare function validateTags(config: VitestRunnerConfig, tags: string[]): void;
40
+ declare function createTagsFilter(tagsExpr: string[], availableTags: TestTagDefinition[]): (testTags: string[]) => boolean;
41
+
34
42
  declare function isTestCase(s: Task): s is Test;
35
43
  declare function getTests(suite: Arrayable<Task>): Test[];
36
44
  declare function getTasks(tasks?: Arrayable<Task>): Task[];
@@ -42,4 +50,4 @@ declare function getFullName(task: Task, separator?: string): string;
42
50
  declare function getTestName(task: Task, separator?: string): string;
43
51
  declare function createTaskName(names: readonly (string | undefined)[], separator?: string): string;
44
52
 
45
- export { calculateSuiteHash, createFileTask, createTaskName, findTestFileStackTrace, generateFileHash, generateHash, getFullName, getNames, getSuites, getTasks, getTestName, getTests, hasFailed, hasTests, interpretTaskModes, isTestCase, limitConcurrency, partitionSuiteChildren, someTasksAreOnly };
53
+ export { calculateSuiteHash, createFileTask, createTagsFilter, createTaskName, findTestFileStackTrace, generateFileHash, generateHash, getFullName, getNames, getSuites, getTasks, getTestName, getTests, hasFailed, hasTests, interpretTaskModes, isTestCase, limitConcurrency, partitionSuiteChildren, someTasksAreOnly, validateTags };
@@ -1,4 +1,4 @@
1
- export { a as calculateSuiteHash, c as createChainable, b as createFileTask, e as createTaskName, f as findTestFileStackTrace, g as generateFileHash, d as generateHash, h as getFullName, j as getNames, k as getSuites, m as getTasks, n as getTestName, o as getTests, q as hasFailed, r as hasTests, i as interpretTaskModes, t as isTestCase, l as limitConcurrency, p as partitionSuiteChildren, s as someTasksAreOnly } from './chunk-tasks.js';
1
+ export { c as calculateSuiteHash, a as createChainable, b as createFileTask, d as createTagsFilter, e as createTaskName, f as findTestFileStackTrace, g as generateFileHash, h as generateHash, i as getFullName, j as getNames, k as getSuites, l as getTasks, m as getTestName, n as getTests, o as hasFailed, p as hasTests, q as interpretTaskModes, r as isTestCase, s as limitConcurrency, t as partitionSuiteChildren, u as someTasksAreOnly, v as validateTags } from './chunk-tasks.js';
2
2
  import '../utils/error.js';
3
3
  import '../utils/source-map.js';
4
4
  import '../../vendor/pathe.mjs';
@@ -1,9 +1,4 @@
1
- interface ParsedStack {
2
- method: string;
3
- file: string;
4
- line: number;
5
- column: number;
6
- }
1
+ import { ParsedStack } from '../utils/index.js';
7
2
 
8
3
  interface SnapshotEnvironment {
9
4
  getVersion: () => string;
@@ -19,4 +14,4 @@ interface SnapshotEnvironmentOptions {
19
14
  snapshotsDirName?: string;
20
15
  }
21
16
 
22
- export type { ParsedStack as P, SnapshotEnvironment as S, SnapshotEnvironmentOptions as a };
17
+ export type { SnapshotEnvironment as S, SnapshotEnvironmentOptions as a };
@@ -1,4 +1,5 @@
1
- import { S as SnapshotEnvironment, a as SnapshotEnvironmentOptions } from './environment.d-DHdQ1Csl.js';
1
+ import { S as SnapshotEnvironment, a as SnapshotEnvironmentOptions } from './environment.d-DOJxxZV9.js';
2
+ import '../utils/index.js';
2
3
 
3
4
  declare class NodeSnapshotEnvironment implements SnapshotEnvironment {
4
5
  private options;
@@ -1,5 +1,5 @@
1
1
  import { promises, existsSync } from 'node:fs';
2
- import { resolve, isAbsolute, dirname, join, basename } from '../../vendor/pathe.mjs';
2
+ import { isAbsolute, resolve, dirname, join, basename } from '../../vendor/pathe.mjs';
3
3
 
4
4
  class NodeSnapshotEnvironment {
5
5
  constructor(options = {}) {
@@ -1,6 +1,7 @@
1
- import { S as SnapshotStateOptions, a as SnapshotMatchOptions, b as SnapshotResult, R as RawSnapshotInfo } from './rawSnapshot.d-lFsMJFUd.js';
2
- export { c as SnapshotData, d as SnapshotSerializer, e as SnapshotSummary, f as SnapshotUpdateState, U as UncheckedSnapshot } from './rawSnapshot.d-lFsMJFUd.js';
3
- import { S as SnapshotEnvironment, P as ParsedStack } from './environment.d-DHdQ1Csl.js';
1
+ import { S as SnapshotStateOptions, a as SnapshotMatchOptions, b as SnapshotResult, R as RawSnapshotInfo } from './rawSnapshot.d-U2kJUxDr.js';
2
+ export { c as SnapshotData, d as SnapshotSerializer, e as SnapshotSummary, f as SnapshotUpdateState, U as UncheckedSnapshot } from './rawSnapshot.d-U2kJUxDr.js';
3
+ import { ParsedStack } from '../utils/index.js';
4
+ import { S as SnapshotEnvironment } from './environment.d-DOJxxZV9.js';
4
5
  import { Plugin, Plugins } from '../pretty-format/index.js';
5
6
 
6
7
  /**