vitest 2.2.0-beta.2 → 3.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 +75 -0
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +1 -1
- package/dist/chunks/{RandomSequencer.BPedXEug.js → RandomSequencer.gisBJ77r.js} +11 -4
- package/dist/chunks/{base.BS0HhLXd.js → base.CkcgFVQd.js} +8 -3
- package/dist/chunks/{cac.Cs06pOqp.js → cac.CWCZimpS.js} +7 -7
- package/dist/chunks/{cli-api.CB-jIbYQ.js → cli-api.BKUOv0Nc.js} +186 -83
- package/dist/chunks/{config.CPguQ7J1.d.ts → config.BTPBhmK5.d.ts} +1 -1
- package/dist/chunks/{creator.IIqd8RWT.js → creator.DcAcUhMD.js} +1 -4
- package/dist/chunks/{globals.BCGEw6ON.js → globals.DJTzb7B3.js} +2 -2
- package/dist/chunks/{index.DD5eTY2y.js → index.BqHViJW9.js} +1 -1
- package/dist/chunks/{index.BjjsHdBb.js → index.CkOJwybT.js} +1 -1
- package/dist/chunks/{index.bzFpKeaq.js → index.DKe7vK-G.js} +530 -144
- package/dist/chunks/{index.CqYx2Nsr.js → index.DQboAxJm.js} +23 -14
- package/dist/chunks/{inspector.70d6emsh.js → inspector.DKLceBVD.js} +1 -1
- package/dist/chunks/{reporters.F9D2idOT.d.ts → reporters.BZbwTvrM.d.ts} +249 -258
- package/dist/chunks/{resolveConfig.CLnvCvEs.js → resolveConfig.3rGGWga5.js} +81 -49
- package/dist/chunks/{runBaseTests.B7hcVT-s.js → runBaseTests.C6huCAng.js} +6 -6
- package/dist/chunks/{setup-common.BfGt8K-K.js → setup-common.B5ClyS48.js} +1 -1
- package/dist/chunks/{utils.DJONn5B5.js → utils.CMUTX-p8.js} +5 -2
- package/dist/chunks/{vi.BlPttogV.js → vi.CZKezqeD.js} +18 -13
- package/dist/chunks/{vite.DonA4fvH.d.ts → vite.DIfmneq0.d.ts} +1 -1
- package/dist/chunks/{vm.Zr4qWzDJ.js → vm.DGhTouO3.js} +10 -1
- package/dist/chunks/{worker.9VY11NZs.d.ts → worker.CmzGeuVD.d.ts} +3 -3
- package/dist/chunks/{worker.Qz1UB4Fv.d.ts → worker.umPNbBNk.d.ts} +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.cjs +1 -10
- package/dist/config.d.ts +4 -5
- package/dist/config.js +1 -10
- package/dist/coverage.d.ts +2 -2
- package/dist/coverage.js +4 -4
- package/dist/execute.d.ts +3 -3
- package/dist/index.d.ts +21 -13
- package/dist/index.js +2 -2
- package/dist/node.d.ts +9 -22
- package/dist/node.js +9 -9
- package/dist/reporters.d.ts +2 -2
- package/dist/reporters.js +5 -4
- package/dist/runners.d.ts +1 -2
- package/dist/runners.js +9 -14
- package/dist/worker.js +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +6 -6
- package/dist/workers/threads.js +1 -1
- package/dist/workers/vmForks.js +1 -1
- package/dist/workers/vmThreads.js +1 -1
- package/dist/workers.d.ts +3 -3
- package/dist/workers.js +3 -3
- package/package.json +21 -22
package/LICENSE.md
CHANGED
|
@@ -931,6 +931,23 @@ Repository: micromatch/micromatch
|
|
|
931
931
|
|
|
932
932
|
---------------------------------------
|
|
933
933
|
|
|
934
|
+
## mimic-fn
|
|
935
|
+
License: MIT
|
|
936
|
+
By: Sindre Sorhus
|
|
937
|
+
Repository: sindresorhus/mimic-fn
|
|
938
|
+
|
|
939
|
+
> MIT License
|
|
940
|
+
>
|
|
941
|
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
942
|
+
>
|
|
943
|
+
> 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:
|
|
944
|
+
>
|
|
945
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
946
|
+
>
|
|
947
|
+
> 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.
|
|
948
|
+
|
|
949
|
+
---------------------------------------
|
|
950
|
+
|
|
934
951
|
## mlly
|
|
935
952
|
License: MIT
|
|
936
953
|
Repository: unjs/mlly
|
|
@@ -959,6 +976,23 @@ Repository: unjs/mlly
|
|
|
959
976
|
|
|
960
977
|
---------------------------------------
|
|
961
978
|
|
|
979
|
+
## onetime
|
|
980
|
+
License: MIT
|
|
981
|
+
By: Sindre Sorhus
|
|
982
|
+
Repository: sindresorhus/onetime
|
|
983
|
+
|
|
984
|
+
> MIT License
|
|
985
|
+
>
|
|
986
|
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
987
|
+
>
|
|
988
|
+
> 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:
|
|
989
|
+
>
|
|
990
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
991
|
+
>
|
|
992
|
+
> 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.
|
|
993
|
+
|
|
994
|
+
---------------------------------------
|
|
995
|
+
|
|
962
996
|
## p-limit
|
|
963
997
|
License: MIT
|
|
964
998
|
By: Sindre Sorhus
|
|
@@ -1137,6 +1171,23 @@ Repository: privatenumber/resolve-pkg-maps
|
|
|
1137
1171
|
|
|
1138
1172
|
---------------------------------------
|
|
1139
1173
|
|
|
1174
|
+
## restore-cursor
|
|
1175
|
+
License: MIT
|
|
1176
|
+
By: Sindre Sorhus
|
|
1177
|
+
Repository: sindresorhus/restore-cursor
|
|
1178
|
+
|
|
1179
|
+
> MIT License
|
|
1180
|
+
>
|
|
1181
|
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
1182
|
+
>
|
|
1183
|
+
> 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:
|
|
1184
|
+
>
|
|
1185
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1186
|
+
>
|
|
1187
|
+
> 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.
|
|
1188
|
+
|
|
1189
|
+
---------------------------------------
|
|
1190
|
+
|
|
1140
1191
|
## reusify
|
|
1141
1192
|
License: MIT
|
|
1142
1193
|
By: Matteo Collina
|
|
@@ -1194,6 +1245,30 @@ Repository: git://github.com/feross/run-parallel.git
|
|
|
1194
1245
|
|
|
1195
1246
|
---------------------------------------
|
|
1196
1247
|
|
|
1248
|
+
## signal-exit
|
|
1249
|
+
License: ISC
|
|
1250
|
+
By: Ben Coe
|
|
1251
|
+
Repository: https://github.com/tapjs/signal-exit.git
|
|
1252
|
+
|
|
1253
|
+
> The ISC License
|
|
1254
|
+
>
|
|
1255
|
+
> Copyright (c) 2015, Contributors
|
|
1256
|
+
>
|
|
1257
|
+
> Permission to use, copy, modify, and/or distribute this software
|
|
1258
|
+
> for any purpose with or without fee is hereby granted, provided
|
|
1259
|
+
> that the above copyright notice and this permission notice
|
|
1260
|
+
> appear in all copies.
|
|
1261
|
+
>
|
|
1262
|
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1263
|
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
1264
|
+
> OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
|
1265
|
+
> LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
|
1266
|
+
> OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
1267
|
+
> WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
1268
|
+
> ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1269
|
+
|
|
1270
|
+
---------------------------------------
|
|
1271
|
+
|
|
1197
1272
|
## sisteransi
|
|
1198
1273
|
License: MIT
|
|
1199
1274
|
By: Terkel Gjervig
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CoverageProvider, c as CoverageProviderModule } from './chunks/reporters.
|
|
2
|
-
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.
|
|
1
|
+
import { b as CoverageProvider, c as CoverageProviderModule } from './chunks/reporters.BZbwTvrM.js';
|
|
2
|
+
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.BTPBhmK5.js';
|
|
3
3
|
import * as spy$1 from '@vitest/spy';
|
|
4
4
|
import * as _vitest_utils_diff from '@vitest/utils/diff';
|
|
5
5
|
import { VitestExecutor } from './execute.js';
|
|
@@ -21,7 +21,7 @@ import 'vite-node/server';
|
|
|
21
21
|
import '@vitest/snapshot/manager';
|
|
22
22
|
import 'node:fs';
|
|
23
23
|
import '@vitest/snapshot/environment';
|
|
24
|
-
import './chunks/worker.
|
|
24
|
+
import './chunks/worker.CmzGeuVD.js';
|
|
25
25
|
import 'node:vm';
|
|
26
26
|
import '@vitest/mocker';
|
|
27
27
|
import './chunks/mocker.cRtM890J.js';
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { g as getCoverageProvider, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.BoMDb1ip.js';
|
|
2
2
|
export { s as SpyModule } from './chunks/spy.Cf_4R5Oe.js';
|
|
3
|
-
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.
|
|
3
|
+
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.B5ClyS48.js';
|
|
4
4
|
export { collectTests, processError, startTests } from '@vitest/runner';
|
|
5
5
|
import '@vitest/spy';
|
|
6
6
|
import '@vitest/snapshot';
|
|
@@ -329,10 +329,9 @@ async function collectTests(ctx, filepath) {
|
|
|
329
329
|
if (!request) {
|
|
330
330
|
return null;
|
|
331
331
|
}
|
|
332
|
-
request.code = request.code.replace(/__vite_ssr_identity__\((\w+\.\w+)\)/g, "( $1)");
|
|
333
332
|
const ast = await parseAstAsync(request.code);
|
|
334
333
|
const testFilepath = relative(ctx.config.root, filepath);
|
|
335
|
-
const projectName = ctx.
|
|
334
|
+
const projectName = ctx.name;
|
|
336
335
|
const typecheckSubprojectName = projectName ? `${projectName}:__typecheck__` : "__typecheck__";
|
|
337
336
|
const file = {
|
|
338
337
|
filepath,
|
|
@@ -363,10 +362,17 @@ async function collectTests(ctx, filepath) {
|
|
|
363
362
|
return getName(callee.tag);
|
|
364
363
|
}
|
|
365
364
|
if (callee.type === "MemberExpression") {
|
|
366
|
-
|
|
365
|
+
const object = callee.object;
|
|
366
|
+
if (object?.name?.startsWith("__vite_ssr_")) {
|
|
367
367
|
return getName(callee.property);
|
|
368
368
|
}
|
|
369
|
-
return getName(
|
|
369
|
+
return getName(object?.property);
|
|
370
|
+
}
|
|
371
|
+
if (callee.type === "SequenceExpression" && callee.expressions.length === 2) {
|
|
372
|
+
const [e0, e1] = callee.expressions;
|
|
373
|
+
if (e0.type === "Literal" && e0.value === 0) {
|
|
374
|
+
return getName(e1);
|
|
375
|
+
}
|
|
370
376
|
}
|
|
371
377
|
return null;
|
|
372
378
|
};
|
|
@@ -467,6 +473,7 @@ async function collectTests(ctx, filepath) {
|
|
|
467
473
|
interpretTaskModes(
|
|
468
474
|
file,
|
|
469
475
|
ctx.config.testNamePattern,
|
|
476
|
+
void 0,
|
|
470
477
|
hasOnly,
|
|
471
478
|
false,
|
|
472
479
|
ctx.config.allowOnly
|
|
@@ -21,14 +21,19 @@ async function runBaseTests(method, state) {
|
|
|
21
21
|
moduleCache.delete(`mock:${fsPath}`);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
ctx.files.forEach((i) => state.moduleCache.delete(
|
|
24
|
+
ctx.files.forEach((i) => state.moduleCache.delete(
|
|
25
|
+
typeof i === "string" ? i : i.filepath
|
|
26
|
+
));
|
|
25
27
|
const [executor, { run }] = await Promise.all([
|
|
26
28
|
startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
|
|
27
|
-
import('./runBaseTests.
|
|
29
|
+
import('./runBaseTests.C6huCAng.js')
|
|
28
30
|
]);
|
|
31
|
+
const fileSpecs = ctx.files.map(
|
|
32
|
+
(f) => typeof f === "string" ? { filepath: f, testLocations: void 0 } : f
|
|
33
|
+
);
|
|
29
34
|
await run(
|
|
30
35
|
method,
|
|
31
|
-
|
|
36
|
+
fileSpecs,
|
|
32
37
|
ctx.config,
|
|
33
38
|
{ environment: state.environment, options: ctx.environment.options },
|
|
34
39
|
executor
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "
|
|
621
|
+
var version = "3.0.0-beta.1";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -1218,7 +1218,7 @@ const cliOptionsConfig = {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
},
|
|
1220
1220
|
project: {
|
|
1221
|
-
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: `--project=1 --project=2`. You can also filter projects using wildcards like `--project=packages
|
|
1221
|
+
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: `--project=1 --project=2`. You can also filter projects using wildcards like `--project=packages*`, and exclude projects with `--project=!pattern`.",
|
|
1222
1222
|
argument: "<name>",
|
|
1223
1223
|
array: true
|
|
1224
1224
|
},
|
|
@@ -1551,13 +1551,13 @@ async function start(mode, cliFilters, options) {
|
|
|
1551
1551
|
} catch {
|
|
1552
1552
|
}
|
|
1553
1553
|
try {
|
|
1554
|
-
const { startVitest } = await import('./cli-api.
|
|
1554
|
+
const { startVitest } = await import('./cli-api.BKUOv0Nc.js').then(function (n) { return n.e; });
|
|
1555
1555
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1556
1556
|
if (!ctx?.shouldKeepServer()) {
|
|
1557
1557
|
await ctx?.exit();
|
|
1558
1558
|
}
|
|
1559
1559
|
} catch (e) {
|
|
1560
|
-
const { divider } = await import('./utils.
|
|
1560
|
+
const { divider } = await import('./utils.CMUTX-p8.js').then(function (n) { return n.u; });
|
|
1561
1561
|
console.error(`
|
|
1562
1562
|
${c.red(divider(c.bold(c.inverse(" Startup Error "))))}`);
|
|
1563
1563
|
console.error(e);
|
|
@@ -1573,7 +1573,7 @@ async function init(project) {
|
|
|
1573
1573
|
console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
|
|
1574
1574
|
process.exit(1);
|
|
1575
1575
|
}
|
|
1576
|
-
const { create } = await import('./creator.
|
|
1576
|
+
const { create } = await import('./creator.DcAcUhMD.js');
|
|
1577
1577
|
await create();
|
|
1578
1578
|
}
|
|
1579
1579
|
async function collect(mode, cliFilters, options) {
|
|
@@ -1582,7 +1582,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1582
1582
|
} catch {
|
|
1583
1583
|
}
|
|
1584
1584
|
try {
|
|
1585
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
1585
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.BKUOv0Nc.js').then(function (n) { return n.e; });
|
|
1586
1586
|
const ctx = await prepareVitest(mode, {
|
|
1587
1587
|
...normalizeCliOptions(options),
|
|
1588
1588
|
watch: false,
|
|
@@ -1604,7 +1604,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
await ctx.close();
|
|
1606
1606
|
} catch (e) {
|
|
1607
|
-
const { divider } = await import('./utils.
|
|
1607
|
+
const { divider } = await import('./utils.CMUTX-p8.js').then(function (n) { return n.u; });
|
|
1608
1608
|
console.error(`
|
|
1609
1609
|
${c.red(divider(c.bold(c.inverse(" Collect Error "))))}`);
|
|
1610
1610
|
console.error(e);
|