vitest 1.5.3 → 2.0.0-beta.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.
- package/LICENSE.md +172 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +4 -4
- package/dist/chunks/environments-node.39w4gmlF.js +19 -0
- package/dist/chunks/{install-pkg.LE8oaA1t.js → install-pkg.DNUmWFkO.js} +2 -2
- package/dist/chunks/integrations-globals.B5Jl0grA.js +31 -0
- package/dist/chunks/{runtime-console.EO5ha7qv.js → runtime-console.CUES-L8X.js} +9 -9
- package/dist/chunks/{runtime-runBaseTests.l6qXp5eU.js → runtime-runBaseTests._dXkRAZc.js} +21 -22
- package/dist/cli.js +3 -3
- package/dist/config.cjs +2 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -3
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +2 -2
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +7 -4
- package/dist/execute.js +3 -3
- package/dist/index.d.ts +770 -21
- package/dist/index.js +12 -12
- package/dist/node.d.ts +2 -2
- package/dist/node.js +21 -22
- package/dist/{reporters-BXNXFKfg.d.ts → reporters-MGvT5U9f.d.ts} +128 -55
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +11 -12
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +17 -18
- package/dist/snapshot.d.ts +9 -0
- package/dist/snapshot.js +8 -0
- package/dist/{suite-KPWE530F.d.ts → suite-8WAe-urM.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +4 -4
- package/dist/vendor/{base.oIzAvGLe.js → base.VFkIJ66g.js} +3 -3
- package/dist/vendor/{base.Xt0Omgh7.js → base._gnK9Slw.js} +8 -1
- package/dist/vendor/{benchmark.yGkUTKnC.js → benchmark.BNLebNi5.js} +1 -1
- package/dist/vendor/{cac.RDd_SGOd.js → cac.DzKZaJu2.js} +39 -17
- package/dist/vendor/{cli-api.AmIc1Dmz.js → cli-api.DTeni0Qq.js} +3201 -404
- package/dist/vendor/{execute.2_yoIC01.js → execute.CLLNVNnK.js} +8 -3
- package/dist/vendor/{index.Fm6OikHU.js → index.BfoZyXD1.js} +20 -21
- package/dist/vendor/{index.8bPxjt7g.js → index.BpSiYbpB.js} +5 -1
- package/dist/vendor/{index.X7lgIMc_.js → index.CRxYS9H3.js} +586 -230
- package/dist/vendor/{index.QVcwRDVW.js → index.CmILuxzC.js} +8 -6
- package/dist/vendor/{index.xL8XjTLv.js → index.DP-km6lF.js} +1 -1
- package/dist/vendor/{index.SMVOaj7F.js → index._7XLd8Kd.js} +2 -2
- package/dist/vendor/{rpc.joBhAkyK.js → rpc.DRDE9Pu1.js} +2 -2
- package/dist/vendor/{run-once.Olz_Zkd8.js → run-once.DLomgGUH.js} +1 -1
- package/dist/vendor/{setup-common.5nUd4r76.js → setup-common.XeoZAW8t.js} +2 -2
- package/dist/vendor/{tasks.IknbGB2n.js → tasks.WC7M-K-v.js} +4 -1
- package/dist/vendor/{utils.VYmeMh-u.js → utils.D5gGkwyH.js} +1 -1
- package/dist/vendor/{vi.Y_w82WR8.js → vi.ClD3hi7L.js} +23 -10
- package/dist/vendor/{vm.i4FO5N37.js → vm.Bi3bljci.js} +132 -54
- package/dist/worker.js +13 -7
- package/dist/workers/forks.js +6 -6
- package/dist/workers/runVmTests.js +22 -20
- package/dist/workers/threads.js +6 -6
- package/dist/workers/vmForks.js +9 -9
- package/dist/workers/vmThreads.js +9 -9
- package/dist/workers.d.ts +1 -1
- package/dist/workers.js +14 -14
- package/package.json +33 -29
- package/snapshot.d.ts +1 -0
- package/vitest.mjs +1 -1
- package/dist/chunks/integrations-globals.Hr6znn-f.js +0 -31
- package/dist/cli-wrapper.js +0 -119
- /package/dist/chunks/{node-git.Hw101KjS.js → node-git.CCI8evVZ.js} +0 -0
- /package/dist/vendor/{_commonjsHelpers.jjO7Zipk.js → _commonjsHelpers.BFTU3MAI.js} +0 -0
- /package/dist/vendor/{constants.5J7I254_.js → constants.5SOfHUj0.js} +0 -0
- /package/dist/vendor/{coverage.E7sG1b3r.js → coverage.ChSqD-qS.js} +0 -0
- /package/dist/vendor/{date.Ns1pGd_X.js → date.BKM1wewY.js} +0 -0
- /package/dist/vendor/{env.AtSIuHFg.js → env.bmJgw1qP.js} +0 -0
- /package/dist/vendor/{global.CkGT_TMy.js → global.7bFbnyXl.js} +0 -0
- /package/dist/vendor/{index.GVFv9dZ0.js → index.DeR1hhfY.js} +0 -0
- /package/dist/vendor/{inspector.IgLX3ur5.js → inspector.hPQncR7V.js} +0 -0
- /package/dist/vendor/{utils.0uYuCbzo.js → utils.CUjzkRH7.js} +0 -0
package/LICENSE.md
CHANGED
|
@@ -196,6 +196,35 @@ Repository: https://github.com/sinonjs/fake-timers.git
|
|
|
196
196
|
|
|
197
197
|
---------------------------------------
|
|
198
198
|
|
|
199
|
+
## acorn-walk
|
|
200
|
+
License: MIT
|
|
201
|
+
By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine
|
|
202
|
+
Repository: https://github.com/acornjs/acorn.git
|
|
203
|
+
|
|
204
|
+
> MIT License
|
|
205
|
+
>
|
|
206
|
+
> Copyright (C) 2012-2020 by various contributors (see AUTHORS)
|
|
207
|
+
>
|
|
208
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
209
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
210
|
+
> in the Software without restriction, including without limitation the rights
|
|
211
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
212
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
213
|
+
> furnished to do so, subject to the following conditions:
|
|
214
|
+
>
|
|
215
|
+
> The above copyright notice and this permission notice shall be included in
|
|
216
|
+
> all copies or substantial portions of the Software.
|
|
217
|
+
>
|
|
218
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
219
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
220
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
221
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
222
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
223
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
224
|
+
> THE SOFTWARE.
|
|
225
|
+
|
|
226
|
+
---------------------------------------
|
|
227
|
+
|
|
199
228
|
## ansi-escapes
|
|
200
229
|
License: MIT
|
|
201
230
|
By: Sindre Sorhus
|
|
@@ -932,6 +961,35 @@ Repository: jonschlinkert/is-number
|
|
|
932
961
|
|
|
933
962
|
---------------------------------------
|
|
934
963
|
|
|
964
|
+
## js-tokens
|
|
965
|
+
License: MIT
|
|
966
|
+
By: Simon Lydell
|
|
967
|
+
Repository: lydell/js-tokens
|
|
968
|
+
|
|
969
|
+
> The MIT License (MIT)
|
|
970
|
+
>
|
|
971
|
+
> Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Simon Lydell
|
|
972
|
+
>
|
|
973
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
974
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
975
|
+
> in the Software without restriction, including without limitation the rights
|
|
976
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
977
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
978
|
+
> furnished to do so, subject to the following conditions:
|
|
979
|
+
>
|
|
980
|
+
> The above copyright notice and this permission notice shall be included in
|
|
981
|
+
> all copies or substantial portions of the Software.
|
|
982
|
+
>
|
|
983
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
984
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
985
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
986
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
987
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
988
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
989
|
+
> THE SOFTWARE.
|
|
990
|
+
|
|
991
|
+
---------------------------------------
|
|
992
|
+
|
|
935
993
|
## kleur
|
|
936
994
|
License: MIT
|
|
937
995
|
By: Luke Edwards
|
|
@@ -961,6 +1019,35 @@ Repository: lukeed/kleur
|
|
|
961
1019
|
|
|
962
1020
|
---------------------------------------
|
|
963
1021
|
|
|
1022
|
+
## local-pkg
|
|
1023
|
+
License: MIT
|
|
1024
|
+
By: Anthony Fu
|
|
1025
|
+
Repository: git+https://github.com/antfu/local-pkg.git
|
|
1026
|
+
|
|
1027
|
+
> MIT License
|
|
1028
|
+
>
|
|
1029
|
+
> Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
|
|
1030
|
+
>
|
|
1031
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1032
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
1033
|
+
> in the Software without restriction, including without limitation the rights
|
|
1034
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1035
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
1036
|
+
> furnished to do so, subject to the following conditions:
|
|
1037
|
+
>
|
|
1038
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
1039
|
+
> copies or substantial portions of the Software.
|
|
1040
|
+
>
|
|
1041
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1042
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1043
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1044
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1045
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1046
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1047
|
+
> SOFTWARE.
|
|
1048
|
+
|
|
1049
|
+
---------------------------------------
|
|
1050
|
+
|
|
964
1051
|
## locate-path
|
|
965
1052
|
License: MIT
|
|
966
1053
|
By: Sindre Sorhus
|
|
@@ -1069,6 +1156,34 @@ Repository: sindresorhus/mimic-fn
|
|
|
1069
1156
|
|
|
1070
1157
|
---------------------------------------
|
|
1071
1158
|
|
|
1159
|
+
## mlly
|
|
1160
|
+
License: MIT
|
|
1161
|
+
Repository: unjs/mlly
|
|
1162
|
+
|
|
1163
|
+
> MIT License
|
|
1164
|
+
>
|
|
1165
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
1166
|
+
>
|
|
1167
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1168
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
1169
|
+
> in the Software without restriction, including without limitation the rights
|
|
1170
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1171
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
1172
|
+
> furnished to do so, subject to the following conditions:
|
|
1173
|
+
>
|
|
1174
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
1175
|
+
> copies or substantial portions of the Software.
|
|
1176
|
+
>
|
|
1177
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1178
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1179
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1180
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1181
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1182
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1183
|
+
> SOFTWARE.
|
|
1184
|
+
|
|
1185
|
+
---------------------------------------
|
|
1186
|
+
|
|
1072
1187
|
## onetime
|
|
1073
1188
|
License: MIT
|
|
1074
1189
|
By: Sindre Sorhus
|
|
@@ -1413,6 +1528,35 @@ Repository: chalk/strip-ansi
|
|
|
1413
1528
|
|
|
1414
1529
|
---------------------------------------
|
|
1415
1530
|
|
|
1531
|
+
## strip-literal
|
|
1532
|
+
License: MIT
|
|
1533
|
+
By: Anthony Fu
|
|
1534
|
+
Repository: git+https://github.com/antfu/strip-literal.git
|
|
1535
|
+
|
|
1536
|
+
> MIT License
|
|
1537
|
+
>
|
|
1538
|
+
> Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
|
|
1539
|
+
>
|
|
1540
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1541
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
1542
|
+
> in the Software without restriction, including without limitation the rights
|
|
1543
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1544
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
1545
|
+
> furnished to do so, subject to the following conditions:
|
|
1546
|
+
>
|
|
1547
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
1548
|
+
> copies or substantial portions of the Software.
|
|
1549
|
+
>
|
|
1550
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1551
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1552
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1553
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1554
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1555
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1556
|
+
> SOFTWARE.
|
|
1557
|
+
|
|
1558
|
+
---------------------------------------
|
|
1559
|
+
|
|
1416
1560
|
## to-regex-range
|
|
1417
1561
|
License: MIT
|
|
1418
1562
|
By: Jon Schlinkert, Rouven Weßling
|
|
@@ -1469,6 +1613,34 @@ Repository: git+ssh://git@github.com/chaijs/type-detect.git
|
|
|
1469
1613
|
|
|
1470
1614
|
---------------------------------------
|
|
1471
1615
|
|
|
1616
|
+
## ufo
|
|
1617
|
+
License: MIT
|
|
1618
|
+
Repository: unjs/ufo
|
|
1619
|
+
|
|
1620
|
+
> MIT License
|
|
1621
|
+
>
|
|
1622
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
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
|
+
|
|
1472
1644
|
## wrap-ansi
|
|
1473
1645
|
License: MIT
|
|
1474
1646
|
By: Sindre Sorhus
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { processError, startTests } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-MGvT5U9f.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
package/dist/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { processError, startTests } from '@vitest/runner';
|
|
2
|
-
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './vendor/setup-common.
|
|
3
|
-
export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor/coverage.
|
|
2
|
+
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './vendor/setup-common.XeoZAW8t.js';
|
|
3
|
+
export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor/coverage.ChSqD-qS.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import '@vitest/snapshot';
|
|
6
|
-
import './vendor/run-once.
|
|
7
|
-
import './vendor/global.
|
|
6
|
+
import './vendor/run-once.DLomgGUH.js';
|
|
7
|
+
import './vendor/global.7bFbnyXl.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
|
|
2
|
+
import 'pathe';
|
|
3
|
+
import '@vitest/runner/utils';
|
|
4
|
+
import '@vitest/utils';
|
|
5
|
+
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
6
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
7
|
+
import 'std-env';
|
|
8
|
+
|
|
9
|
+
class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
|
|
10
|
+
getHeader() {
|
|
11
|
+
return `// Vitest Snapshot v${this.getVersion()}, https://vitest.dev/guide/snapshot.html`;
|
|
12
|
+
}
|
|
13
|
+
resolvePath(filepath) {
|
|
14
|
+
const rpc = getWorkerState().rpc;
|
|
15
|
+
return rpc.resolveSnapshotPath(filepath);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { VitestNodeSnapshotEnvironment };
|
|
@@ -25,12 +25,12 @@ var __privateAdd = (obj, member, value) => {
|
|
|
25
25
|
};
|
|
26
26
|
var __privateSet = (obj, member, value, setter) => {
|
|
27
27
|
__accessCheck(obj, member, "write to private field");
|
|
28
|
-
|
|
28
|
+
member.set(obj, value);
|
|
29
29
|
return value;
|
|
30
30
|
};
|
|
31
31
|
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
32
32
|
set _(value) {
|
|
33
|
-
__privateSet(obj, member, value
|
|
33
|
+
__privateSet(obj, member, value);
|
|
34
34
|
},
|
|
35
35
|
get _() {
|
|
36
36
|
return __privateGet(obj, member, getter);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { g as globalApis } from '../vendor/constants.5SOfHUj0.js';
|
|
2
|
+
import { V as VitestIndex } from '../vendor/index.CmILuxzC.js';
|
|
3
|
+
import '@vitest/runner';
|
|
4
|
+
import '../vendor/benchmark.BNLebNi5.js';
|
|
5
|
+
import '@vitest/runner/utils';
|
|
6
|
+
import '@vitest/utils';
|
|
7
|
+
import '../vendor/index._7XLd8Kd.js';
|
|
8
|
+
import 'pathe';
|
|
9
|
+
import '../vendor/global.7bFbnyXl.js';
|
|
10
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
11
|
+
import 'std-env';
|
|
12
|
+
import '../vendor/run-once.DLomgGUH.js';
|
|
13
|
+
import '../vendor/vi.ClD3hi7L.js';
|
|
14
|
+
import 'chai';
|
|
15
|
+
import '../vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
16
|
+
import '@vitest/expect';
|
|
17
|
+
import '@vitest/snapshot';
|
|
18
|
+
import '@vitest/utils/error';
|
|
19
|
+
import '../vendor/tasks.WC7M-K-v.js';
|
|
20
|
+
import '@vitest/utils/source-map';
|
|
21
|
+
import '../vendor/base._gnK9Slw.js';
|
|
22
|
+
import '../vendor/date.BKM1wewY.js';
|
|
23
|
+
import '@vitest/spy';
|
|
24
|
+
|
|
25
|
+
function registerApiGlobally() {
|
|
26
|
+
globalApis.forEach((api) => {
|
|
27
|
+
globalThis[api] = VitestIndex[api];
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { registerApiGlobally };
|
|
@@ -2,11 +2,11 @@ import { Writable } from 'node:stream';
|
|
|
2
2
|
import { Console } from 'node:console';
|
|
3
3
|
import { relative } from 'node:path';
|
|
4
4
|
import { getSafeTimers, getColors } from '@vitest/utils';
|
|
5
|
-
import { R as RealDate } from '../vendor/date.
|
|
5
|
+
import { R as RealDate } from '../vendor/date.BKM1wewY.js';
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
|
-
import { g as getWorkerState } from '../vendor/global.
|
|
9
|
-
import '../vendor/env.
|
|
8
|
+
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
9
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
10
10
|
import 'std-env';
|
|
11
11
|
|
|
12
12
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
@@ -24,12 +24,12 @@ function getTaskIdByStack(root) {
|
|
|
24
24
|
return relative(root, filepath);
|
|
25
25
|
return UNKNOWN_TEST_ID;
|
|
26
26
|
}
|
|
27
|
-
function createCustomConsole() {
|
|
27
|
+
function createCustomConsole(defaultState) {
|
|
28
28
|
const stdoutBuffer = /* @__PURE__ */ new Map();
|
|
29
29
|
const stderrBuffer = /* @__PURE__ */ new Map();
|
|
30
30
|
const timers = /* @__PURE__ */ new Map();
|
|
31
31
|
const { setTimeout, clearTimeout } = getSafeTimers();
|
|
32
|
-
const state = () => getWorkerState();
|
|
32
|
+
const state = () => defaultState || getWorkerState();
|
|
33
33
|
function schedule(taskId) {
|
|
34
34
|
const timer = timers.get(taskId);
|
|
35
35
|
const { stdoutTime, stderrTime } = timer;
|
|
@@ -78,9 +78,9 @@ function createCustomConsole() {
|
|
|
78
78
|
}
|
|
79
79
|
const stdout = new Writable({
|
|
80
80
|
write(data, encoding, callback) {
|
|
81
|
-
var _a, _b, _c;
|
|
81
|
+
var _a, _b, _c, _d;
|
|
82
82
|
const s = state();
|
|
83
|
-
const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.
|
|
83
|
+
const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.suite) == null ? void 0 : _c.id) || ((_d = s.current) == null ? void 0 : _d.file.id) || getTaskIdByStack(s.config.root);
|
|
84
84
|
let timer = timers.get(id);
|
|
85
85
|
if (timer) {
|
|
86
86
|
timer.stdoutTime = timer.stdoutTime || RealDate.now();
|
|
@@ -100,9 +100,9 @@ function createCustomConsole() {
|
|
|
100
100
|
});
|
|
101
101
|
const stderr = new Writable({
|
|
102
102
|
write(data, encoding, callback) {
|
|
103
|
-
var _a, _b, _c;
|
|
103
|
+
var _a, _b, _c, _d;
|
|
104
104
|
const s = state();
|
|
105
|
-
const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.
|
|
105
|
+
const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.suite) == null ? void 0 : _c.id) || ((_d = s.current) == null ? void 0 : _d.file.id) || getTaskIdByStack(s.config.root);
|
|
106
106
|
let timer = timers.get(id);
|
|
107
107
|
if (timer) {
|
|
108
108
|
timer.stderrTime = timer.stderrTime || RealDate.now();
|
|
@@ -3,41 +3,40 @@ import { startTests } from '@vitest/runner';
|
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
|
|
6
|
-
import { g as getWorkerState } from '../vendor/global.
|
|
7
|
-
import '../vendor/env.
|
|
8
|
-
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.
|
|
9
|
-
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.
|
|
10
|
-
import {
|
|
6
|
+
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
7
|
+
import '../vendor/env.bmJgw1qP.js';
|
|
8
|
+
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.ClD3hi7L.js';
|
|
9
|
+
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.ChSqD-qS.js';
|
|
10
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.BfoZyXD1.js';
|
|
11
11
|
import { createRequire } from 'node:module';
|
|
12
12
|
import util from 'node:util';
|
|
13
13
|
import timers from 'node:timers';
|
|
14
14
|
import { isatty } from 'node:tty';
|
|
15
15
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
16
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
17
|
-
import { s as setupCommonEnv } from '../vendor/setup-common.
|
|
18
|
-
import { c as closeInspector } from '../vendor/inspector.
|
|
16
|
+
import { V as VitestIndex } from '../vendor/index.CmILuxzC.js';
|
|
17
|
+
import { s as setupCommonEnv } from '../vendor/setup-common.XeoZAW8t.js';
|
|
18
|
+
import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
|
|
19
19
|
import 'std-env';
|
|
20
20
|
import 'chai';
|
|
21
|
-
import '../vendor/_commonjsHelpers.
|
|
21
|
+
import '../vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
22
22
|
import '@vitest/expect';
|
|
23
23
|
import '@vitest/snapshot';
|
|
24
24
|
import '@vitest/utils/error';
|
|
25
|
-
import '../vendor/tasks.
|
|
25
|
+
import '../vendor/tasks.WC7M-K-v.js';
|
|
26
26
|
import '@vitest/utils/source-map';
|
|
27
|
-
import '../vendor/base.
|
|
28
|
-
import '../vendor/date.
|
|
27
|
+
import '../vendor/base._gnK9Slw.js';
|
|
28
|
+
import '../vendor/date.BKM1wewY.js';
|
|
29
29
|
import '@vitest/spy';
|
|
30
|
-
import '@vitest/snapshot/environment';
|
|
31
30
|
import '../path.js';
|
|
32
31
|
import 'node:url';
|
|
33
|
-
import '../vendor/rpc.
|
|
34
|
-
import '../vendor/index.
|
|
35
|
-
import '../vendor/benchmark.
|
|
36
|
-
import '../vendor/index.
|
|
37
|
-
import '../vendor/run-once.
|
|
32
|
+
import '../vendor/rpc.DRDE9Pu1.js';
|
|
33
|
+
import '../vendor/index.BpSiYbpB.js';
|
|
34
|
+
import '../vendor/benchmark.BNLebNi5.js';
|
|
35
|
+
import '../vendor/index._7XLd8Kd.js';
|
|
36
|
+
import '../vendor/run-once.DLomgGUH.js';
|
|
38
37
|
|
|
39
38
|
let globalSetup = false;
|
|
40
|
-
async function setupGlobalEnv(config, { environment }) {
|
|
39
|
+
async function setupGlobalEnv(config, { environment }, executor) {
|
|
41
40
|
await setupCommonEnv(config);
|
|
42
41
|
Object.defineProperty(globalThis, "__vitest_index__", {
|
|
43
42
|
value: VitestIndex,
|
|
@@ -45,7 +44,7 @@ async function setupGlobalEnv(config, { environment }) {
|
|
|
45
44
|
});
|
|
46
45
|
const state = getWorkerState();
|
|
47
46
|
if (!state.config.snapshotOptions.snapshotEnvironment)
|
|
48
|
-
state.config.snapshotOptions.snapshotEnvironment =
|
|
47
|
+
state.config.snapshotOptions.snapshotEnvironment = await resolveSnapshotEnvironment(config, executor);
|
|
49
48
|
if (globalSetup)
|
|
50
49
|
return;
|
|
51
50
|
globalSetup = true;
|
|
@@ -71,7 +70,7 @@ async function setupGlobalEnv(config, { environment }) {
|
|
|
71
70
|
await setupConsoleLogSpy();
|
|
72
71
|
}
|
|
73
72
|
async function setupConsoleLogSpy() {
|
|
74
|
-
const { createCustomConsole } = await import('./runtime-console.
|
|
73
|
+
const { createCustomConsole } = await import('./runtime-console.CUES-L8X.js');
|
|
75
74
|
globalThis.console = createCustomConsole();
|
|
76
75
|
}
|
|
77
76
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -91,7 +90,7 @@ async function withEnv({ environment }, options, fn) {
|
|
|
91
90
|
|
|
92
91
|
async function run(files, config, environment, executor) {
|
|
93
92
|
const workerState = getWorkerState();
|
|
94
|
-
await setupGlobalEnv(config, environment);
|
|
93
|
+
await setupGlobalEnv(config, environment, executor);
|
|
95
94
|
await startCoverageInsideWorker(config.coverage, executor);
|
|
96
95
|
if (config.chaiConfig)
|
|
97
96
|
setupChaiConfig(config.chaiConfig);
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as createCLI } from './vendor/cac.
|
|
1
|
+
import { c as createCLI } from './vendor/cac.DzKZaJu2.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'picocolors';
|
|
5
|
-
import './vendor/base.
|
|
5
|
+
import './vendor/base._gnK9Slw.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import './vendor/constants.
|
|
7
|
+
import './vendor/constants.5SOfHUj0.js';
|
|
8
8
|
|
|
9
9
|
createCLI().parse();
|
package/dist/config.cjs
CHANGED
|
@@ -23,7 +23,7 @@ const defaultCoverageExcludes = [
|
|
|
23
23
|
"cypress/**",
|
|
24
24
|
"test?(s)/**",
|
|
25
25
|
"test?(-*).?(c|m)[jt]s?(x)",
|
|
26
|
-
"**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)",
|
|
26
|
+
"**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)",
|
|
27
27
|
"**/__tests__/**",
|
|
28
28
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
29
29
|
"**/vitest.{workspace,projects}.[jt]s?(on)",
|
|
@@ -41,7 +41,7 @@ const coverageConfigDefaults = {
|
|
|
41
41
|
reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
|
|
42
42
|
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte", ".marko"],
|
|
43
43
|
allowExternal: false,
|
|
44
|
-
ignoreEmptyLines:
|
|
44
|
+
ignoreEmptyLines: true,
|
|
45
45
|
processingConcurrency: Math.min(20, ((_b = (_a = os).availableParallelism) == null ? void 0 : _b.call(_a)) ?? os.cpus().length)
|
|
46
46
|
};
|
|
47
47
|
const fakeTimersDefaults = {
|
|
@@ -72,7 +72,6 @@ const config = {
|
|
|
72
72
|
testTimeout: 5e3,
|
|
73
73
|
hookTimeout: 1e4,
|
|
74
74
|
teardownTimeout: 1e4,
|
|
75
|
-
watchExclude: ["**/node_modules/**", "**/dist/**"],
|
|
76
75
|
forceRerunTriggers: [
|
|
77
76
|
"**/package.json/**",
|
|
78
77
|
"**/{vitest,vite}.config.*/**"
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export {
|
|
2
|
+
export { ax as UserConfigExport, aw as UserConfigFn, au as UserConfigFnObject, av as UserConfigFnPromise, az as UserProjectConfigExport, ay as UserProjectConfigFn, a1 as UserWorkspaceConfig, aD as configDefaults, aG as coverageConfigDefaults, aF as defaultExclude, aE as defaultInclude, aA as defineConfig, aB as defineProject, aC as defineWorkspace, aH as extraInlineDeps } from './reporters-MGvT5U9f.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
5
5
|
import '@vitest/snapshot';
|
package/dist/config.js
CHANGED
|
@@ -21,7 +21,7 @@ const defaultCoverageExcludes = [
|
|
|
21
21
|
"cypress/**",
|
|
22
22
|
"test?(s)/**",
|
|
23
23
|
"test?(-*).?(c|m)[jt]s?(x)",
|
|
24
|
-
"**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)",
|
|
24
|
+
"**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)",
|
|
25
25
|
"**/__tests__/**",
|
|
26
26
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
27
27
|
"**/vitest.{workspace,projects}.[jt]s?(on)",
|
|
@@ -39,7 +39,7 @@ const coverageConfigDefaults = {
|
|
|
39
39
|
reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
|
|
40
40
|
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte", ".marko"],
|
|
41
41
|
allowExternal: false,
|
|
42
|
-
ignoreEmptyLines:
|
|
42
|
+
ignoreEmptyLines: true,
|
|
43
43
|
processingConcurrency: Math.min(20, ((_b = (_a = os).availableParallelism) == null ? void 0 : _b.call(_a)) ?? os.cpus().length)
|
|
44
44
|
};
|
|
45
45
|
const fakeTimersDefaults = {
|
|
@@ -70,7 +70,6 @@ const config = {
|
|
|
70
70
|
testTimeout: 5e3,
|
|
71
71
|
hookTimeout: 1e4,
|
|
72
72
|
teardownTimeout: 1e4,
|
|
73
|
-
watchExclude: ["**/node_modules/**", "**/dist/**"],
|
|
74
73
|
forceRerunTriggers: [
|
|
75
74
|
"**/package.json/**",
|
|
76
75
|
"**/{vitest,vite}.config.*/**"
|
package/dist/coverage.d.ts
CHANGED
package/dist/coverage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { relative } from 'pathe';
|
|
2
|
-
import { m as mm } from './vendor/index.
|
|
3
|
-
import './vendor/_commonjsHelpers.
|
|
2
|
+
import { m as mm } from './vendor/index.DP-km6lF.js';
|
|
3
|
+
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
4
4
|
import 'util';
|
|
5
5
|
import 'path';
|
|
6
6
|
|
package/dist/environments.d.ts
CHANGED
package/dist/environments.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { e as builtinEnvironments, p as populateGlobal } from './vendor/index.
|
|
1
|
+
export { e as builtinEnvironments, p as populateGlobal } from './vendor/index.DeR1hhfY.js';
|
|
2
2
|
import 'node:console';
|
package/dist/execute.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vm from 'node:vm';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
3
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
4
|
-
import {
|
|
4
|
+
import { ar as PendingSuiteMock, as as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, at as MockMap } from './reporters-MGvT5U9f.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -84,6 +84,7 @@ declare class VMModule {
|
|
|
84
84
|
declare class FileMap {
|
|
85
85
|
private fsCache;
|
|
86
86
|
private fsBufferCache;
|
|
87
|
+
readFileAsync(path: string): Promise<string>;
|
|
87
88
|
readFile(path: string): string;
|
|
88
89
|
readBuffer(path: string): Buffer;
|
|
89
90
|
}
|
|
@@ -97,6 +98,7 @@ interface ExternalModulesExecutorOptions {
|
|
|
97
98
|
viteClientModule: Record<string, unknown>;
|
|
98
99
|
}
|
|
99
100
|
declare class ExternalModulesExecutor {
|
|
101
|
+
#private;
|
|
100
102
|
private options;
|
|
101
103
|
private cjs;
|
|
102
104
|
private esm;
|
|
@@ -105,6 +107,9 @@ declare class ExternalModulesExecutor {
|
|
|
105
107
|
private fs;
|
|
106
108
|
private resolvers;
|
|
107
109
|
constructor(options: ExternalModulesExecutorOptions);
|
|
110
|
+
import(identifier: string): Promise<Object>;
|
|
111
|
+
require(identifier: string): any;
|
|
112
|
+
createRequire(identifier: string): NodeRequire;
|
|
108
113
|
importModuleDynamically: (specifier: string, referencer: VMModule) => Promise<VMModule>;
|
|
109
114
|
resolveModule: (specifier: string, referencer: string) => Promise<VMModule>;
|
|
110
115
|
resolve(specifier: string, parent: string): string;
|
|
@@ -113,9 +118,7 @@ declare class ExternalModulesExecutor {
|
|
|
113
118
|
private wrapCommonJsSynteticModule;
|
|
114
119
|
private getModuleInformation;
|
|
115
120
|
private createModule;
|
|
116
|
-
|
|
117
|
-
require(identifier: string): any;
|
|
118
|
-
createRequire(identifier: string): NodeRequire;
|
|
121
|
+
private get isNetworkSupported();
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
interface ExecuteOptions extends ViteNodeRunnerOptions {
|
package/dist/execute.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { V as VitestExecutor } from './vendor/execute.
|
|
1
|
+
export { V as VitestExecutor } from './vendor/execute.CLLNVNnK.js';
|
|
2
2
|
import 'node:vm';
|
|
3
3
|
import 'node:url';
|
|
4
|
+
import 'node:fs';
|
|
4
5
|
import 'vite-node/client';
|
|
5
6
|
import 'vite-node/utils';
|
|
6
7
|
import 'pathe';
|
|
7
8
|
import '@vitest/utils/error';
|
|
8
9
|
import './path.js';
|
|
9
|
-
import 'node:fs';
|
|
10
10
|
import '@vitest/utils';
|
|
11
|
-
import './vendor/base.
|
|
11
|
+
import './vendor/base._gnK9Slw.js';
|