@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,5 @@
1
+ /// <reference path="./importMeta.d.ts" />
2
+
3
+ // https://github.com/microsoft/TypeScript/issues/45096
4
+ // TypeScript has a bug that makes <reference types="vite/types/importMeta" />
5
+ // not possible in userland. This file provides a workaround for now.
@@ -0,0 +1,4 @@
1
+ interface ImportMeta {
2
+ url: string
3
+ readonly vitest?: typeof import('vitest')
4
+ }
package/index.cjs ADDED
@@ -0,0 +1,5 @@
1
+ throw new Error(
2
+ 'Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead.'
3
+ + '\n\nIf you are using "import" in your source code, then it\'s possible it was bundled into require() automatically by your bundler. '
4
+ + 'In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic import() which is available in all CommonJS modules.',
5
+ )
package/index.d.cts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/index.js'
package/jsdom.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { JSDOM } from 'jsdom'
2
+
3
+ declare global {
4
+ const jsdom: JSDOM
5
+ }
6
+ export {}
package/mocker.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/mocker.js'
package/node.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/node.js'
@@ -0,0 +1,7 @@
1
+ /* eslint-disable ts/ban-ts-comment */
2
+
3
+ // @ts-ignore optional peer dep
4
+ export type * as jsdomTypes from 'jsdom'
5
+
6
+ // @ts-ignore optional peer dep
7
+ export type * as happyDomTypes from 'happy-dom'
package/package.json ADDED
@@ -0,0 +1,224 @@
1
+ {
2
+ "name": "@depup/vitest",
3
+ "type": "module",
4
+ "version": "4.0.18-depup.0",
5
+ "description": "Next generation testing framework powered by Vite",
6
+ "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
+ "license": "MIT",
8
+ "funding": "https://opencollective.com/vitest",
9
+ "homepage": "https://vitest.dev",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/vitest-dev/vitest.git",
13
+ "directory": "packages/vitest"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/vitest-dev/vitest/issues"
17
+ },
18
+ "keywords": [
19
+ "vite",
20
+ "vitest",
21
+ "test",
22
+ "jest"
23
+ ],
24
+ "sideEffects": false,
25
+ "imports": {
26
+ "#module-evaluator": {
27
+ "types": "./dist/module-evaluator.d.ts",
28
+ "default": "./dist/module-evaluator.js"
29
+ }
30
+ },
31
+ "exports": {
32
+ ".": {
33
+ "import": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "require": {
38
+ "types": "./index.d.cts",
39
+ "default": "./index.cjs"
40
+ }
41
+ },
42
+ "./browser": {
43
+ "types": "./browser/context.d.ts",
44
+ "default": "./browser/context.js"
45
+ },
46
+ "./package.json": "./package.json",
47
+ "./optional-types.js": {
48
+ "types": "./optional-types.d.ts"
49
+ },
50
+ "./src/*": "./src/*",
51
+ "./globals": {
52
+ "types": "./globals.d.ts"
53
+ },
54
+ "./jsdom": {
55
+ "types": "./jsdom.d.ts"
56
+ },
57
+ "./importMeta": {
58
+ "types": "./importMeta.d.ts"
59
+ },
60
+ "./import-meta": {
61
+ "types": "./import-meta.d.ts"
62
+ },
63
+ "./node": {
64
+ "types": "./dist/node.d.ts",
65
+ "default": "./dist/node.js"
66
+ },
67
+ "./internal/browser": {
68
+ "types": "./dist/browser.d.ts",
69
+ "default": "./dist/browser.js"
70
+ },
71
+ "./internal/module-runner": {
72
+ "types": "./dist/module-runner.d.ts",
73
+ "default": "./dist/module-runner.js"
74
+ },
75
+ "./runners": {
76
+ "types": "./dist/runners.d.ts",
77
+ "default": "./dist/runners.js"
78
+ },
79
+ "./suite": {
80
+ "types": "./dist/suite.d.ts",
81
+ "default": "./dist/suite.js"
82
+ },
83
+ "./environments": {
84
+ "types": "./dist/environments.d.ts",
85
+ "default": "./dist/environments.js"
86
+ },
87
+ "./config": {
88
+ "types": "./config.d.ts",
89
+ "require": "./dist/config.cjs",
90
+ "default": "./dist/config.js"
91
+ },
92
+ "./coverage": {
93
+ "types": "./coverage.d.ts",
94
+ "default": "./dist/coverage.js"
95
+ },
96
+ "./reporters": {
97
+ "types": "./dist/reporters.d.ts",
98
+ "default": "./dist/reporters.js"
99
+ },
100
+ "./snapshot": {
101
+ "types": "./dist/snapshot.d.ts",
102
+ "default": "./dist/snapshot.js"
103
+ },
104
+ "./mocker": {
105
+ "types": "./dist/mocker.d.ts",
106
+ "default": "./dist/mocker.js"
107
+ },
108
+ "./worker": {
109
+ "types": "./worker.d.ts",
110
+ "default": "./dist/worker.js"
111
+ }
112
+ },
113
+ "main": "./dist/index.js",
114
+ "module": "./dist/index.js",
115
+ "types": "./dist/index.d.ts",
116
+ "bin": {
117
+ "vitest": "./vitest.mjs"
118
+ },
119
+ "files": [
120
+ "*.cjs",
121
+ "*.d.cts",
122
+ "*.d.ts",
123
+ "*.mjs",
124
+ "bin",
125
+ "browser",
126
+ "dist"
127
+ ],
128
+ "engines": {
129
+ "node": "^20.0.0 || ^22.0.0 || >=24.0.0"
130
+ },
131
+ "peerDependencies": {
132
+ "@edge-runtime/vm": "*",
133
+ "@opentelemetry/api": "^1.9.0",
134
+ "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
135
+ "happy-dom": "*",
136
+ "jsdom": "*",
137
+ "@vitest/browser-playwright": "4.0.18",
138
+ "@vitest/browser-preview": "4.0.18",
139
+ "@vitest/browser-webdriverio": "4.0.18",
140
+ "@vitest/ui": "4.0.18"
141
+ },
142
+ "peerDependenciesMeta": {
143
+ "@edge-runtime/vm": {
144
+ "optional": true
145
+ },
146
+ "@opentelemetry/api": {
147
+ "optional": true
148
+ },
149
+ "@types/node": {
150
+ "optional": true
151
+ },
152
+ "@vitest/browser-playwright": {
153
+ "optional": true
154
+ },
155
+ "@vitest/browser-preview": {
156
+ "optional": true
157
+ },
158
+ "@vitest/browser-webdriverio": {
159
+ "optional": true
160
+ },
161
+ "@vitest/ui": {
162
+ "optional": true
163
+ },
164
+ "happy-dom": {
165
+ "optional": true
166
+ },
167
+ "jsdom": {
168
+ "optional": true
169
+ }
170
+ },
171
+ "dependencies": {
172
+ "es-module-lexer": "^2.0.0",
173
+ "expect-type": "^1.3.0",
174
+ "magic-string": "^0.30.21",
175
+ "obug": "^2.1.1",
176
+ "pathe": "^2.0.3",
177
+ "picomatch": "^4.0.3",
178
+ "std-env": "^4.0.0-rc.1",
179
+ "tinybench": "^6.0.0",
180
+ "tinyexec": "^1.0.2",
181
+ "tinyglobby": "^0.2.15",
182
+ "tinyrainbow": "^3.0.3",
183
+ "vite": "^6.0.0 || ^7.0.0",
184
+ "why-is-node-running": "^3.2.2",
185
+ "@vitest/mocker": "4.0.18",
186
+ "@vitest/expect": "4.0.18",
187
+ "@vitest/runner": "4.0.18",
188
+ "@vitest/pretty-format": "4.0.18",
189
+ "@vitest/snapshot": "4.0.18",
190
+ "@vitest/spy": "4.0.18",
191
+ "@vitest/utils": "4.0.18"
192
+ },
193
+ "devDependencies": {
194
+ "@antfu/install-pkg": "^1.1.0",
195
+ "@edge-runtime/vm": "^5.0.0",
196
+ "@jridgewell/trace-mapping": "0.3.31",
197
+ "@opentelemetry/api": "^1.9.0",
198
+ "@sinonjs/fake-timers": "14.0.0",
199
+ "@types/estree": "^1.0.8",
200
+ "@types/istanbul-lib-coverage": "^2.0.6",
201
+ "@types/istanbul-reports": "^3.0.4",
202
+ "@types/jsdom": "^27.0.0",
203
+ "@types/node": "^24.10.1",
204
+ "@types/picomatch": "^4.0.2",
205
+ "@types/prompts": "^2.4.9",
206
+ "@types/sinonjs__fake-timers": "^8.1.5",
207
+ "acorn-walk": "^8.3.4",
208
+ "birpc": "^4.0.0",
209
+ "cac": "^6.7.14",
210
+ "empathic": "^2.0.0",
211
+ "flatted": "^3.3.3",
212
+ "happy-dom": "^20.0.11",
213
+ "jsdom": "^27.2.0",
214
+ "local-pkg": "^1.1.2",
215
+ "mime": "^4.1.0",
216
+ "prompts": "^2.4.2",
217
+ "strip-literal": "^3.1.0",
218
+ "ws": "^8.18.3"
219
+ },
220
+ "scripts": {
221
+ "build": "premove dist && rollup -c",
222
+ "dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" rollup -c --watch -m inline"
223
+ }
224
+ }
package/reporters.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/reporters.js'
package/runners.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/runners.js'
package/snapshot.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/snapshot.js'
package/suite.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/suite.js'
@@ -0,0 +1,21 @@
1
+ // borrowed from tsx implementation:
2
+ // https://github.com/esbuild-kit/tsx
3
+
4
+ const ignoreWarnings = new Set([
5
+ '--experimental-loader is an experimental feature. This feature could change at any time',
6
+ 'Custom ESM Loaders is an experimental feature. This feature could change at any time',
7
+ 'Custom ESM Loaders is an experimental feature and might change at any time',
8
+ 'VM Modules is an experimental feature and might change at any time',
9
+ 'VM Modules is an experimental feature. This feature could change at any time',
10
+ ])
11
+
12
+ const { emit } = process
13
+
14
+ process.emit = function (event, warning) {
15
+ if (event === 'warning' && ignoreWarnings.has(warning.message)) {
16
+ return
17
+ }
18
+
19
+ // eslint-disable-next-line prefer-rest-params
20
+ return Reflect.apply(emit, this, arguments)
21
+ }
package/vitest.mjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import './dist/cli.js'
package/worker.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/worker.js'