vitest 4.0.0-beta.8 → 4.0.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.
- package/LICENSE.md +86 -102
- package/browser/context.d.ts +7 -0
- package/browser/context.js +20 -0
- package/dist/browser.d.ts +26 -9
- package/dist/browser.js +17 -7
- package/dist/chunks/base.CtHM3ryk.js +128 -0
- package/dist/chunks/{benchmark.UW6Ezvxy.js → benchmark.DHKMYAts.js} +2 -2
- package/dist/chunks/{browser.d.DOMmqJQx.d.ts → browser.d.B9iJzZyn.d.ts} +3 -3
- package/dist/chunks/{cac.By1HvRIk.js → cac.B99MQg-w.js} +47 -91
- package/dist/chunks/{cli-api.C-JHgQgp.js → cli-api.PwHwIMss.js} +1544 -310
- package/dist/chunks/{config.d._GBBbReY.d.ts → config.d.u2CUDWwS.d.ts} +6 -19
- package/dist/chunks/{console.B0quX7yH.js → console.CTJL2nuH.js} +4 -6
- package/dist/chunks/{coverage.DarITf6U.js → coverage.FU3w4IrQ.js} +128 -1142
- package/dist/chunks/{creator.KEg6n5IC.js → creator.DucAaYBz.js} +10 -37
- package/dist/chunks/{defaults.CXFFjsi8.js → defaults.BOqNVLsY.js} +0 -1
- package/dist/chunks/environment.d.CrsxCzP1.d.ts +29 -0
- package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
- package/dist/chunks/{global.d.K6uBQHzY.d.ts → global.d.BgJSTpgQ.d.ts} +2 -17
- package/dist/chunks/{globals.lgsmH00r.js → globals.BGT_RUsD.js} +12 -9
- package/dist/chunks/{index.BuwjkI-q.js → index.BdSLhLDZ.js} +3 -3
- package/dist/chunks/{index.DfviD7lX.js → index.CbWINfS7.js} +49 -21
- package/dist/chunks/{index.AzwzFtyi.js → index.CcRZ6fUh.js} +1493 -114
- package/dist/chunks/{index.X0nbfr6-.js → index.Dc3xnDvT.js} +48 -289
- package/dist/chunks/{index.AR8aAkCC.js → index.RwjEGCQ0.js} +7 -8
- package/dist/chunks/init-forks.DSafeltJ.js +54 -0
- package/dist/chunks/init-threads.SUtZ-067.js +17 -0
- package/dist/chunks/init.B2EESLQM.js +213 -0
- package/dist/chunks/{inspector.CvQD-Nie.js → inspector.DLZxSeU3.js} +2 -6
- package/dist/chunks/{moduleRunner.d.CX4DuqOx.d.ts → moduleRunner.d.YtNsMIoJ.d.ts} +12 -14
- package/dist/chunks/{node.BOqcT2jW.js → node.BwAWWjHZ.js} +3 -4
- package/dist/chunks/{plugin.d.CHe6slQs.d.ts → plugin.d.DQU1R5px.d.ts} +1 -1
- package/dist/chunks/{reporters.d.37tJQ2uV.d.ts → reporters.d.BMKt7f6I.d.ts} +1066 -1030
- package/dist/chunks/{index.CsFXYRkW.js → resolveSnapshotEnvironment.DJJKMKxb.js} +18 -24
- package/dist/chunks/{rpc.RpPylpp0.js → rpc.cD77ENhU.js} +13 -14
- package/dist/chunks/{setup-common.hLGRxhC8.js → setup-common.DR1sucx6.js} +8 -8
- package/dist/chunks/{startModuleRunner.C8TW8zTN.js → startModuleRunner.C2tTvmF9.js} +131 -110
- package/dist/chunks/test.C3RPt8JR.js +214 -0
- package/dist/chunks/{utils.C7__0Iv5.js → utils.CG9h5ccR.js} +3 -15
- package/dist/chunks/{vi.BfdOiD4j.js → vi.BZvkKVkM.js} +73 -176
- package/dist/chunks/{vm.BHBje7cC.js → vm.DBeOXrP9.js} +29 -33
- package/dist/chunks/{worker.d.DYlqbejz.d.ts → worker.d.BFk-vvBU.d.ts} +42 -6
- package/dist/cli.js +12 -11
- package/dist/config.cjs +0 -1
- package/dist/config.d.ts +12 -14
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +8 -7
- package/dist/coverage.js +3 -14
- package/dist/environments.d.ts +3 -6
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +24 -30
- package/dist/index.js +12 -11
- package/dist/module-evaluator.d.ts +6 -4
- package/dist/module-evaluator.js +14 -16
- package/dist/module-runner.js +5 -5
- package/dist/node.d.ts +83 -27
- package/dist/node.js +23 -20
- package/dist/reporters.d.ts +11 -10
- package/dist/reporters.js +12 -11
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +14 -216
- package/dist/snapshot.js +3 -3
- package/dist/suite.js +4 -3
- package/dist/worker.d.ts +26 -0
- package/dist/worker.js +45 -166
- package/dist/workers/forks.js +41 -35
- package/dist/workers/runVmTests.js +25 -22
- package/dist/workers/threads.js +41 -23
- package/dist/workers/vmForks.js +26 -39
- package/dist/workers/vmThreads.js +26 -29
- package/package.json +48 -35
- package/worker.d.ts +1 -0
- package/browser.d.ts +0 -1
- package/dist/chunks/base.BXI97p6t.js +0 -39
- package/dist/chunks/environment.d.2fYMoz3o.d.ts +0 -66
- package/dist/chunks/moduleTransport.I-bgQy0S.js +0 -19
- package/dist/chunks/resolver.Bx6lE0iq.js +0 -119
- package/dist/chunks/runBaseTests.D6sfuWBM.js +0 -99
- package/dist/chunks/typechecker.DSo_maXz.js +0 -762
- package/dist/chunks/utils.C2YI6McM.js +0 -52
- package/dist/chunks/worker.d.BKu8cnnX.d.ts +0 -8
- package/dist/workers.d.ts +0 -38
- package/dist/workers.js +0 -31
- package/execute.d.ts +0 -1
- package/utils.d.ts +0 -1
- package/workers.d.ts +0 -1
package/LICENSE.md
CHANGED
|
@@ -57,6 +57,87 @@ Repository: git+https://github.com/antfu/install-pkg.git
|
|
|
57
57
|
|
|
58
58
|
---------------------------------------
|
|
59
59
|
|
|
60
|
+
## @jridgewell/resolve-uri
|
|
61
|
+
License: MIT
|
|
62
|
+
By: Justin Ridgewell
|
|
63
|
+
Repository: https://github.com/jridgewell/resolve-uri
|
|
64
|
+
|
|
65
|
+
> Copyright 2019 Justin Ridgewell <jridgewell@google.com>
|
|
66
|
+
>
|
|
67
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
68
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
69
|
+
> in the Software without restriction, including without limitation the rights
|
|
70
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
71
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
72
|
+
> furnished to do so, subject to the following conditions:
|
|
73
|
+
>
|
|
74
|
+
> The above copyright notice and this permission notice shall be included in
|
|
75
|
+
> all copies or substantial portions of the Software.
|
|
76
|
+
>
|
|
77
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
78
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
79
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
80
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
81
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
82
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
83
|
+
> SOFTWARE.
|
|
84
|
+
|
|
85
|
+
---------------------------------------
|
|
86
|
+
|
|
87
|
+
## @jridgewell/sourcemap-codec
|
|
88
|
+
License: MIT
|
|
89
|
+
By: Justin Ridgewell
|
|
90
|
+
Repository: git+https://github.com/jridgewell/sourcemaps.git
|
|
91
|
+
|
|
92
|
+
> Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
|
93
|
+
>
|
|
94
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
95
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
96
|
+
> in the Software without restriction, including without limitation the rights
|
|
97
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
98
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
99
|
+
> furnished to do so, subject to the following conditions:
|
|
100
|
+
>
|
|
101
|
+
> The above copyright notice and this permission notice shall be included in
|
|
102
|
+
> all copies or substantial portions of the Software.
|
|
103
|
+
>
|
|
104
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
> SOFTWARE.
|
|
111
|
+
|
|
112
|
+
---------------------------------------
|
|
113
|
+
|
|
114
|
+
## @jridgewell/trace-mapping
|
|
115
|
+
License: MIT
|
|
116
|
+
By: Justin Ridgewell
|
|
117
|
+
Repository: git+https://github.com/jridgewell/sourcemaps.git
|
|
118
|
+
|
|
119
|
+
> Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
|
120
|
+
>
|
|
121
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
122
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
123
|
+
> in the Software without restriction, including without limitation the rights
|
|
124
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
125
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
126
|
+
> furnished to do so, subject to the following conditions:
|
|
127
|
+
>
|
|
128
|
+
> The above copyright notice and this permission notice shall be included in
|
|
129
|
+
> all copies or substantial portions of the Software.
|
|
130
|
+
>
|
|
131
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
132
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
133
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
134
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
135
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
136
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
137
|
+
> SOFTWARE.
|
|
138
|
+
|
|
139
|
+
---------------------------------------
|
|
140
|
+
|
|
60
141
|
## @sinonjs/commons
|
|
61
142
|
License: BSD-3-Clause
|
|
62
143
|
Repository: git+https://github.com/sinonjs/commons.git
|
|
@@ -199,43 +280,14 @@ Repository: egoist/cac
|
|
|
199
280
|
|
|
200
281
|
---------------------------------------
|
|
201
282
|
|
|
202
|
-
##
|
|
203
|
-
License: MIT
|
|
204
|
-
By: Andrii Shumada, Robert Herhold
|
|
205
|
-
Repository: https://github.com/debitoor/chai-subset.git
|
|
206
|
-
|
|
207
|
-
> The MIT License (MIT)
|
|
208
|
-
>
|
|
209
|
-
> Copyright (c) 2014
|
|
210
|
-
>
|
|
211
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
212
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
213
|
-
> in the Software without restriction, including without limitation the rights
|
|
214
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
215
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
216
|
-
> furnished to do so, subject to the following conditions:
|
|
217
|
-
>
|
|
218
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
219
|
-
> copies or substantial portions of the Software.
|
|
220
|
-
>
|
|
221
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
222
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
223
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
224
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
225
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
226
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
227
|
-
> SOFTWARE.
|
|
228
|
-
|
|
229
|
-
---------------------------------------
|
|
230
|
-
|
|
231
|
-
## find-up
|
|
283
|
+
## empathic
|
|
232
284
|
License: MIT
|
|
233
|
-
By:
|
|
234
|
-
Repository:
|
|
285
|
+
By: Luke Edwards
|
|
286
|
+
Repository: lukeed/empathic
|
|
235
287
|
|
|
236
288
|
> MIT License
|
|
237
289
|
>
|
|
238
|
-
> Copyright (c)
|
|
290
|
+
> Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
239
291
|
>
|
|
240
292
|
> 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:
|
|
241
293
|
>
|
|
@@ -329,7 +381,7 @@ Repository: lukeed/kleur
|
|
|
329
381
|
## local-pkg
|
|
330
382
|
License: MIT
|
|
331
383
|
By: Anthony Fu
|
|
332
|
-
Repository: git+https://github.com/antfu/local-pkg.git
|
|
384
|
+
Repository: git+https://github.com/antfu-collective/local-pkg.git
|
|
333
385
|
|
|
334
386
|
> MIT License
|
|
335
387
|
>
|
|
@@ -355,23 +407,6 @@ Repository: git+https://github.com/antfu/local-pkg.git
|
|
|
355
407
|
|
|
356
408
|
---------------------------------------
|
|
357
409
|
|
|
358
|
-
## locate-path
|
|
359
|
-
License: MIT
|
|
360
|
-
By: Sindre Sorhus
|
|
361
|
-
Repository: sindresorhus/locate-path
|
|
362
|
-
|
|
363
|
-
> MIT License
|
|
364
|
-
>
|
|
365
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
366
|
-
>
|
|
367
|
-
> 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:
|
|
368
|
-
>
|
|
369
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
370
|
-
>
|
|
371
|
-
> 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.
|
|
372
|
-
|
|
373
|
-
---------------------------------------
|
|
374
|
-
|
|
375
410
|
## mime
|
|
376
411
|
License: MIT
|
|
377
412
|
By: Robert Kieffer
|
|
@@ -429,40 +464,6 @@ Repository: unjs/mlly
|
|
|
429
464
|
|
|
430
465
|
---------------------------------------
|
|
431
466
|
|
|
432
|
-
## p-limit
|
|
433
|
-
License: MIT
|
|
434
|
-
By: Sindre Sorhus
|
|
435
|
-
Repository: sindresorhus/p-limit
|
|
436
|
-
|
|
437
|
-
> MIT License
|
|
438
|
-
>
|
|
439
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
440
|
-
>
|
|
441
|
-
> 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:
|
|
442
|
-
>
|
|
443
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
444
|
-
>
|
|
445
|
-
> 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.
|
|
446
|
-
|
|
447
|
-
---------------------------------------
|
|
448
|
-
|
|
449
|
-
## p-locate
|
|
450
|
-
License: MIT
|
|
451
|
-
By: Sindre Sorhus
|
|
452
|
-
Repository: sindresorhus/p-locate
|
|
453
|
-
|
|
454
|
-
> MIT License
|
|
455
|
-
>
|
|
456
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
457
|
-
>
|
|
458
|
-
> 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:
|
|
459
|
-
>
|
|
460
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
461
|
-
>
|
|
462
|
-
> 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.
|
|
463
|
-
|
|
464
|
-
---------------------------------------
|
|
465
|
-
|
|
466
467
|
## package-manager-detector
|
|
467
468
|
License: MIT
|
|
468
469
|
By: Anthony Fu
|
|
@@ -688,20 +689,3 @@ Repository: git+https://github.com/websockets/ws.git
|
|
|
688
689
|
> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
689
690
|
> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
690
691
|
> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
691
|
-
|
|
692
|
-
---------------------------------------
|
|
693
|
-
|
|
694
|
-
## yocto-queue
|
|
695
|
-
License: MIT
|
|
696
|
-
By: Sindre Sorhus
|
|
697
|
-
Repository: sindresorhus/yocto-queue
|
|
698
|
-
|
|
699
|
-
> MIT License
|
|
700
|
-
>
|
|
701
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
702
|
-
>
|
|
703
|
-
> 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:
|
|
704
|
-
>
|
|
705
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
706
|
-
>
|
|
707
|
-
> 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.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @ts-ignore -- @vitest/browser-playwright might not be installed
|
|
2
|
+
export * from '@vitest/browser-playwright/context'
|
|
3
|
+
// @ts-ignore -- @vitest/browser-webdriverio might not be installed
|
|
4
|
+
export * from '@vitest/browser-webdriverio/context'
|
|
5
|
+
// @ts-ignore -- @vitest/browser-preview might not be installed
|
|
6
|
+
export * from '@vitest/browser-preview/context'
|
|
7
|
+
export { BrowserCommands, FsOptions } from 'vitest/internal/browser'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Vitest resolves "vitest/browser" as a virtual module instead
|
|
2
|
+
|
|
3
|
+
// fake exports for static analysis
|
|
4
|
+
export const page = null
|
|
5
|
+
export const server = null
|
|
6
|
+
export const userEvent = null
|
|
7
|
+
export const cdp = null
|
|
8
|
+
export const commands = null
|
|
9
|
+
export const locators = null
|
|
10
|
+
export const utils = null
|
|
11
|
+
|
|
12
|
+
const pool = globalThis.__vitest_worker__?.ctx?.pool
|
|
13
|
+
|
|
14
|
+
throw new Error(
|
|
15
|
+
// eslint-disable-next-line prefer-template
|
|
16
|
+
'vitest/browser can be imported only inside the Browser Mode. '
|
|
17
|
+
+ (pool
|
|
18
|
+
? `Your test is running in ${pool} pool. Make sure your regular tests are excluded from the "test.include" glob pattern.`
|
|
19
|
+
: 'Instead, it was imported outside of Vitest.'),
|
|
20
|
+
)
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.u2CUDWwS.js';
|
|
2
2
|
import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
|
|
3
3
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
4
|
-
import { V as VitestModuleRunner } from './chunks/moduleRunner.d.
|
|
5
|
-
export { collectTests,
|
|
6
|
-
import * as
|
|
7
|
-
export {
|
|
8
|
-
export { LoupeOptions, ParsedStack, StringifyOptions
|
|
9
|
-
export {
|
|
4
|
+
import { V as VitestModuleRunner } from './chunks/moduleRunner.d.YtNsMIoJ.js';
|
|
5
|
+
export { collectTests, startTests } from '@vitest/runner';
|
|
6
|
+
import * as _vitest_spy from '@vitest/spy';
|
|
7
|
+
export { _vitest_spy as SpyModule };
|
|
8
|
+
export { LoupeOptions, ParsedStack, StringifyOptions } from '@vitest/utils';
|
|
9
|
+
export { format, inspect, stringify } from '@vitest/utils/display';
|
|
10
|
+
export { processError } from '@vitest/utils/error';
|
|
11
|
+
export { getType } from '@vitest/utils/helpers';
|
|
12
|
+
export { DecodedMap, getOriginalPosition } from '@vitest/utils/source-map';
|
|
13
|
+
export { getSafeTimers, setSafeTimers } from '@vitest/utils/timers';
|
|
10
14
|
import '@vitest/pretty-format';
|
|
11
15
|
import '@vitest/snapshot';
|
|
12
16
|
import 'node:vm';
|
|
13
17
|
import 'vite/module-runner';
|
|
14
|
-
import './chunks/worker.d.
|
|
15
|
-
import './chunks/environment.d.
|
|
18
|
+
import './chunks/worker.d.BFk-vvBU.js';
|
|
19
|
+
import './chunks/environment.d.CrsxCzP1.js';
|
|
16
20
|
import '@vitest/mocker';
|
|
17
21
|
import './chunks/mocker.d.BE_2ls6u.js';
|
|
18
22
|
|
|
@@ -28,4 +32,17 @@ declare function setupCommonEnv(config: SerializedConfig): Promise<void>;
|
|
|
28
32
|
declare function loadDiffConfig(config: SerializedConfig, moduleRunner: VitestModuleRunner): Promise<SerializedDiffOptions | undefined>;
|
|
29
33
|
declare function loadSnapshotSerializers(config: SerializedConfig, moduleRunner: VitestModuleRunner): Promise<void>;
|
|
30
34
|
|
|
35
|
+
interface FsOptions {
|
|
36
|
+
encoding?: BufferEncoding;
|
|
37
|
+
flag?: string | number;
|
|
38
|
+
}
|
|
39
|
+
interface BrowserCommands {
|
|
40
|
+
readFile: (path: string, options?: BufferEncoding | FsOptions) => Promise<string>;
|
|
41
|
+
writeFile: (path: string, content: string, options?: BufferEncoding | (FsOptions & {
|
|
42
|
+
mode?: number | string;
|
|
43
|
+
})) => Promise<void>;
|
|
44
|
+
removeFile: (path: string) => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
|
|
31
47
|
export { loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
|
|
48
|
+
export type { BrowserCommands, FsOptions };
|
package/dist/browser.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.
|
|
2
|
-
export { collectTests,
|
|
3
|
-
import * as
|
|
4
|
-
export {
|
|
5
|
-
export { format,
|
|
6
|
-
export {
|
|
1
|
+
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.DR1sucx6.js';
|
|
2
|
+
export { collectTests, startTests } from '@vitest/runner';
|
|
3
|
+
import * as spyModule from '@vitest/spy';
|
|
4
|
+
export { spyModule as SpyModule };
|
|
5
|
+
export { format, inspect, stringify } from '@vitest/utils/display';
|
|
6
|
+
export { processError } from '@vitest/utils/error';
|
|
7
|
+
export { getType } from '@vitest/utils/helpers';
|
|
8
|
+
export { DecodedMap, getOriginalPosition } from '@vitest/utils/source-map';
|
|
9
|
+
export { getSafeTimers, setSafeTimers } from '@vitest/utils/timers';
|
|
7
10
|
import './chunks/coverage.D_JHT54q.js';
|
|
8
11
|
import '@vitest/snapshot';
|
|
9
|
-
import './chunks/utils.
|
|
12
|
+
import './chunks/utils.CG9h5ccR.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
const __INTERNAL = { _extendedMethods: /* @__PURE__ */ new Set() };
|
|
18
|
+
|
|
19
|
+
export { __INTERNAL };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { runInThisContext } from 'node:vm';
|
|
2
|
+
import * as spyModule from '@vitest/spy';
|
|
3
|
+
import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
|
|
4
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startModuleRunner.C2tTvmF9.js';
|
|
5
|
+
import { performance } from 'node:perf_hooks';
|
|
6
|
+
import { startTests, collectTests } from '@vitest/runner';
|
|
7
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './resolveSnapshotEnvironment.DJJKMKxb.js';
|
|
8
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.DR1sucx6.js';
|
|
9
|
+
import { g as globalExpect, v as vi } from './vi.BZvkKVkM.js';
|
|
10
|
+
import { c as closeInspector } from './inspector.DLZxSeU3.js';
|
|
11
|
+
import { createRequire } from 'node:module';
|
|
12
|
+
import timers from 'node:timers';
|
|
13
|
+
import timersPromises from 'node:timers/promises';
|
|
14
|
+
import util from 'node:util';
|
|
15
|
+
import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
|
|
16
|
+
import { getSafeTimers } from '@vitest/utils/timers';
|
|
17
|
+
import { i as index } from './index.RwjEGCQ0.js';
|
|
18
|
+
import { g as getWorkerState, r as resetModules, p as provideWorkerState } from './utils.CG9h5ccR.js';
|
|
19
|
+
|
|
20
|
+
// this should only be used in Node
|
|
21
|
+
let globalSetup = false;
|
|
22
|
+
async function setupGlobalEnv(config, { environment }, moduleRunner) {
|
|
23
|
+
await setupCommonEnv(config), Object.defineProperty(globalThis, "__vitest_index__", {
|
|
24
|
+
value: index,
|
|
25
|
+
enumerable: false
|
|
26
|
+
});
|
|
27
|
+
const state = getWorkerState();
|
|
28
|
+
if (!state.config.snapshotOptions.snapshotEnvironment) state.config.snapshotOptions.snapshotEnvironment = await resolveSnapshotEnvironment(config, moduleRunner);
|
|
29
|
+
if (!globalSetup) {
|
|
30
|
+
if (globalSetup = true, (environment.viteEnvironment || environment.name) === "client") {
|
|
31
|
+
const _require = createRequire(import.meta.url);
|
|
32
|
+
_require.extensions[".css"] = resolveCss, _require.extensions[".scss"] = resolveCss, _require.extensions[".sass"] = resolveCss, _require.extensions[".less"] = resolveCss, KNOWN_ASSET_TYPES.forEach((type) => {
|
|
33
|
+
_require.extensions[`.${type}`] = resolveAsset;
|
|
34
|
+
}), process.env.SSR = "";
|
|
35
|
+
} else process.env.SSR = "1";
|
|
36
|
+
if (globalThis.__vitest_required__ = {
|
|
37
|
+
util,
|
|
38
|
+
timers,
|
|
39
|
+
timersPromises
|
|
40
|
+
}, !config.disableConsoleIntercept) await setupConsoleLogSpy();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function resolveCss(mod) {
|
|
44
|
+
mod.exports = "";
|
|
45
|
+
}
|
|
46
|
+
function resolveAsset(mod, url) {
|
|
47
|
+
mod.exports = url;
|
|
48
|
+
}
|
|
49
|
+
async function setupConsoleLogSpy() {
|
|
50
|
+
const { createCustomConsole } = await import('./console.CTJL2nuH.js');
|
|
51
|
+
globalThis.console = createCustomConsole();
|
|
52
|
+
}
|
|
53
|
+
async function withEnv({ environment }, options, fn) {
|
|
54
|
+
globalThis.__vitest_environment__ = environment.name, globalExpect.setState({ environment: environment.name });
|
|
55
|
+
const env = await environment.setup(globalThis, options);
|
|
56
|
+
try {
|
|
57
|
+
await fn();
|
|
58
|
+
} finally {
|
|
59
|
+
// Run possible setTimeouts, e.g. the onces used by ConsoleLogSpy
|
|
60
|
+
const { setTimeout } = getSafeTimers();
|
|
61
|
+
await new Promise((resolve) => setTimeout(resolve)), await env.teardown(globalThis);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// browser shouldn't call this!
|
|
66
|
+
async function run(method, files, config, environment, moduleRunner) {
|
|
67
|
+
const workerState = getWorkerState();
|
|
68
|
+
if (await setupGlobalEnv(config, environment, moduleRunner), await startCoverageInsideWorker(config.coverage, moduleRunner, { isolate: config.isolate }), config.chaiConfig) setupChaiConfig(config.chaiConfig);
|
|
69
|
+
const runner = await resolveTestRunner(config, moduleRunner);
|
|
70
|
+
workerState.onCancel.then((reason) => {
|
|
71
|
+
closeInspector(config), runner.cancel?.(reason);
|
|
72
|
+
}), workerState.durations.prepare = performance.now() - workerState.durations.prepare, workerState.durations.environment = performance.now(), await withEnv(environment, environment.options || config.environmentOptions || {}, async () => {
|
|
73
|
+
workerState.durations.environment = performance.now() - workerState.durations.environment;
|
|
74
|
+
for (const file of files) {
|
|
75
|
+
if (config.isolate) moduleRunner.mocker.reset(), resetModules(workerState.evaluatedModules, true);
|
|
76
|
+
if (workerState.filepath = file.filepath, method === "run") await startTests([file], runner);
|
|
77
|
+
else await collectTests([file], runner);
|
|
78
|
+
// mocks should not affect different files
|
|
79
|
+
vi.resetConfig(), vi.restoreAllMocks();
|
|
80
|
+
}
|
|
81
|
+
await stopCoverageInsideWorker(config.coverage, moduleRunner, { isolate: config.isolate });
|
|
82
|
+
}), workerState.environmentTeardownRun = true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
let _moduleRunner;
|
|
86
|
+
const evaluatedModules = new VitestEvaluatedModules(), moduleExecutionInfo = /* @__PURE__ */ new Map();
|
|
87
|
+
function startModuleRunner(options) {
|
|
88
|
+
return _moduleRunner || (_moduleRunner = startVitestModuleRunner(options), _moduleRunner);
|
|
89
|
+
}
|
|
90
|
+
/** @experimental */
|
|
91
|
+
async function runBaseTests(method, state) {
|
|
92
|
+
const { ctx } = state;
|
|
93
|
+
if (state.evaluatedModules = evaluatedModules, state.moduleExecutionInfo = moduleExecutionInfo, provideWorkerState(globalThis, state), ctx.invalidates) ctx.invalidates.forEach((filepath) => {
|
|
94
|
+
(state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
|
|
95
|
+
state.evaluatedModules.invalidateModule(module);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
ctx.files.forEach((i) => {
|
|
99
|
+
const filepath = typeof i === "string" ? i : i.filepath;
|
|
100
|
+
(state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
|
|
101
|
+
state.evaluatedModules.invalidateModule(module);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
const executor = startModuleRunner({
|
|
105
|
+
state,
|
|
106
|
+
evaluatedModules: state.evaluatedModules,
|
|
107
|
+
spyModule,
|
|
108
|
+
createImportMeta: createNodeImportMeta
|
|
109
|
+
}), fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
|
|
110
|
+
filepath: f,
|
|
111
|
+
testLocations: void 0
|
|
112
|
+
} : f);
|
|
113
|
+
// we could load @vite/env, but it would take ~8ms, while this takes ~0,02ms
|
|
114
|
+
if (ctx.config.serializedDefines) try {
|
|
115
|
+
runInThisContext(`(() =>{\n${ctx.config.serializedDefines}})()`, {
|
|
116
|
+
lineOffset: 1,
|
|
117
|
+
filename: "virtual:load-defines.js"
|
|
118
|
+
});
|
|
119
|
+
} catch (error) {
|
|
120
|
+
throw new Error(`Failed to load custom "defines": ${error.message}`);
|
|
121
|
+
}
|
|
122
|
+
await run(method, fileSpecs, ctx.config, {
|
|
123
|
+
environment: state.environment,
|
|
124
|
+
options: ctx.environment.options
|
|
125
|
+
}, executor);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { runBaseTests as r };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentSuite } from '@vitest/runner';
|
|
2
2
|
import { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
import { noop } from '@vitest/utils';
|
|
4
|
-
import { g as getWorkerState } from './utils.
|
|
3
|
+
import { noop } from '@vitest/utils/helpers';
|
|
4
|
+
import { g as getWorkerState } from './utils.CG9h5ccR.js';
|
|
5
5
|
|
|
6
6
|
const benchFns = /* @__PURE__ */ new WeakMap(), benchOptsMap = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getBenchOptions(key) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FileSpecification } from '@vitest/runner';
|
|
2
|
+
import { T as TestExecutionMethod } from './worker.d.BFk-vvBU.js';
|
|
2
3
|
|
|
3
4
|
type SerializedTestSpecification = [project: {
|
|
4
5
|
name: string | undefined;
|
|
@@ -10,9 +11,8 @@ type SerializedTestSpecification = [project: {
|
|
|
10
11
|
|
|
11
12
|
interface BrowserTesterOptions {
|
|
12
13
|
method: TestExecutionMethod;
|
|
13
|
-
files:
|
|
14
|
+
files: FileSpecification[];
|
|
14
15
|
providedContext: string;
|
|
15
|
-
startTime: number;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export type { BrowserTesterOptions as B, SerializedTestSpecification as S };
|