vitest 2.1.1 → 2.1.2
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/dist/browser.d.ts +5 -5
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.BlXpj3e_.js → base.DwXGwWst.js} +1 -10
- package/dist/chunks/{base.CsQmmYBA.js → base.tiemDJX6.js} +1 -1
- package/dist/chunks/{benchmark.puBFxyfE.d.ts → benchmark.JVlTzojj.d.ts} +2 -0
- package/dist/chunks/{cac.BVmpoFAv.js → cac.B9PaPYY1.js} +7 -7
- package/dist/chunks/cli-api.CHxC4-U8.js +11754 -0
- package/dist/chunks/{config.CHuotKvS.d.ts → config.Crbj2GAb.d.ts} +3 -0
- package/dist/chunks/{creator.BteLTfY8.js → creator.Cf-MKt9i.js} +4 -7
- package/dist/chunks/{environment.C5eAp3K6.d.ts → environment.CzISCQ7o.d.ts} +1 -0
- package/dist/chunks/{globals.C03P0O1a.js → globals.HsM2o-0O.js} +3 -3
- package/dist/chunks/{index.Bn75ITYg.js → index.BpojBOif.js} +34 -25
- package/dist/chunks/{index.DkN6V87F.js → index.Ckn0Cw1h.js} +2 -1
- package/dist/chunks/{index.zPibhCkV.js → index.FcPVJkIQ.js} +633 -582
- package/dist/chunks/index.mAqbj9F9.js +140 -0
- package/dist/chunks/{reporters.WnPwkmgA.d.ts → reporters.DAfKSDh5.d.ts} +17 -12
- package/dist/chunks/{resolveConfig.-K5hHm0S.js → resolveConfig.D1DENLPF.js} +3490 -3338
- package/dist/chunks/{runBaseTests.9YDrdSI4.js → runBaseTests.D-Gcin7G.js} +5 -5
- package/dist/chunks/{setup-common.DV1PI68g.js → setup-common.DF96bIYE.js} +1 -1
- package/dist/chunks/{suite.CcK46U-P.d.ts → suite.BMWOKiTe.d.ts} +1 -1
- package/dist/chunks/{utils.Dbnmsfq1.js → utils.CY6Spixo.js} +26 -47
- package/dist/chunks/vi.DUs2eKik.js +3943 -0
- package/dist/chunks/{vite.D2yAwzwa.d.ts → vite.8fk186v-.d.ts} +1 -1
- package/dist/chunks/{worker.CmPmTxgH.d.ts → worker.Chrs-_NL.d.ts} +2 -2
- package/dist/chunks/{worker.Bws9Zuxu.d.ts → worker.Qtv8v5nL.d.ts} +1 -1
- package/dist/cli.js +2 -2
- package/dist/config.cjs +2 -1
- package/dist/config.d.ts +5 -5
- package/dist/config.js +2 -1
- package/dist/coverage.d.ts +4 -4
- package/dist/coverage.js +2 -2
- package/dist/environments.d.ts +2 -2
- package/dist/execute.d.ts +3 -3
- package/dist/index.d.ts +14 -14
- package/dist/index.js +5 -5
- package/dist/node.d.ts +8 -8
- package/dist/node.js +9 -9
- package/dist/reporters.d.ts +4 -4
- package/dist/reporters.js +4 -3
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +8 -2
- package/dist/suite.d.ts +2 -2
- package/dist/worker.js +11 -3
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +8 -5
- package/dist/workers/threads.js +1 -1
- package/dist/workers.d.ts +4 -4
- package/dist/workers.js +2 -2
- package/package.json +11 -12
- package/dist/chunks/cli-api.BKkmK21J.js +0 -11404
- package/dist/chunks/index.iyKRMe3s.js +0 -131
- package/dist/chunks/vi.D6IHiKAI.js +0 -3746
|
@@ -185,6 +185,9 @@ interface SerializedConfig {
|
|
|
185
185
|
standalone: boolean;
|
|
186
186
|
logHeapUsage: boolean | undefined;
|
|
187
187
|
coverage: SerializedCoverageConfig;
|
|
188
|
+
benchmark?: {
|
|
189
|
+
includeSamples: boolean;
|
|
190
|
+
};
|
|
188
191
|
}
|
|
189
192
|
interface SerializedCoverageConfig {
|
|
190
193
|
provider: 'istanbul' | 'v8' | 'custom' | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolve, dirname, relative } from 'node:path';
|
|
2
2
|
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
4
|
-
import { p as prompt, f as findUp } from './index.
|
|
4
|
+
import { p as prompt, f as findUp } from './index.BpojBOif.js';
|
|
5
5
|
import c from 'tinyrainbow';
|
|
6
6
|
import { detectPackageManager, installPackage } from './index.CPD77dLA.js';
|
|
7
7
|
import { x } from 'tinyexec';
|
|
@@ -323,7 +323,7 @@ function getFrameworkTestPackage(framework) {
|
|
|
323
323
|
case "preact":
|
|
324
324
|
return "@testing-library/preact";
|
|
325
325
|
case "solid":
|
|
326
|
-
return "
|
|
326
|
+
return "@solidjs/testing-library";
|
|
327
327
|
case "marko":
|
|
328
328
|
return "@marko/testing-library";
|
|
329
329
|
}
|
|
@@ -446,11 +446,8 @@ async function generateWorkspaceFile(options) {
|
|
|
446
446
|
`import { defineWorkspace } from 'vitest/config'`,
|
|
447
447
|
"",
|
|
448
448
|
"export default defineWorkspace([",
|
|
449
|
-
" //
|
|
450
|
-
|
|
451
|
-
" // You can safely remove it from the workspace file",
|
|
452
|
-
" // Or move the browser test configuration to the config file.",
|
|
453
|
-
` '${relativeRoot}',`,
|
|
449
|
+
" // If you want to keep running your existing tests in Node.js, uncomment the next line.",
|
|
450
|
+
` // '${relativeRoot}',`,
|
|
454
451
|
` {`,
|
|
455
452
|
` extends: '${relativeRoot}',`,
|
|
456
453
|
` test: {`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as globalApis } from './constants.fzPh7AOq.js';
|
|
2
|
-
import { V as VitestIndex } from './index.
|
|
2
|
+
import { V as VitestIndex } from './index.mAqbj9F9.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import './benchmark.C8CRJYG4.js';
|
|
5
5
|
import '@vitest/runner/utils';
|
|
@@ -10,7 +10,7 @@ import './utils.Ck2hJTRs.js';
|
|
|
10
10
|
import './env.CmHVDJnw.js';
|
|
11
11
|
import 'std-env';
|
|
12
12
|
import './run-once.Sxe67Wng.js';
|
|
13
|
-
import './vi.
|
|
13
|
+
import './vi.DUs2eKik.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import './_commonjsHelpers.BFTU3MAI.js';
|
|
16
16
|
import '@vitest/expect';
|
|
@@ -18,7 +18,7 @@ import '@vitest/snapshot';
|
|
|
18
18
|
import '@vitest/utils/error';
|
|
19
19
|
import './tasks.BZnCS9aT.js';
|
|
20
20
|
import '@vitest/utils/source-map';
|
|
21
|
-
import './base.
|
|
21
|
+
import './base.DwXGwWst.js';
|
|
22
22
|
import './date.W2xKR2qe.js';
|
|
23
23
|
import '@vitest/spy';
|
|
24
24
|
|
|
@@ -3261,11 +3261,11 @@ function requireElements$1 () {
|
|
|
3261
3261
|
return elements$1;
|
|
3262
3262
|
}
|
|
3263
3263
|
|
|
3264
|
-
var hasRequiredPrompts$
|
|
3264
|
+
var hasRequiredPrompts$2;
|
|
3265
3265
|
|
|
3266
|
-
function requirePrompts$
|
|
3267
|
-
if (hasRequiredPrompts$
|
|
3268
|
-
hasRequiredPrompts$
|
|
3266
|
+
function requirePrompts$2 () {
|
|
3267
|
+
if (hasRequiredPrompts$2) return prompts$2;
|
|
3268
|
+
hasRequiredPrompts$2 = 1;
|
|
3269
3269
|
(function (exports) {
|
|
3270
3270
|
|
|
3271
3271
|
const $ = exports;
|
|
@@ -3515,7 +3515,7 @@ function requireDist () {
|
|
|
3515
3515
|
|
|
3516
3516
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3517
3517
|
|
|
3518
|
-
const prompts = requirePrompts$
|
|
3518
|
+
const prompts = requirePrompts$2();
|
|
3519
3519
|
|
|
3520
3520
|
const passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];
|
|
3521
3521
|
|
|
@@ -6229,11 +6229,11 @@ function requireElements () {
|
|
|
6229
6229
|
return elements;
|
|
6230
6230
|
}
|
|
6231
6231
|
|
|
6232
|
-
var hasRequiredPrompts;
|
|
6232
|
+
var hasRequiredPrompts$1;
|
|
6233
6233
|
|
|
6234
|
-
function requirePrompts () {
|
|
6235
|
-
if (hasRequiredPrompts) return prompts$1;
|
|
6236
|
-
hasRequiredPrompts = 1;
|
|
6234
|
+
function requirePrompts$1 () {
|
|
6235
|
+
if (hasRequiredPrompts$1) return prompts$1;
|
|
6236
|
+
hasRequiredPrompts$1 = 1;
|
|
6237
6237
|
(function (exports) {
|
|
6238
6238
|
const $ = exports;
|
|
6239
6239
|
const el = requireElements();
|
|
@@ -6451,7 +6451,7 @@ function requireLib () {
|
|
|
6451
6451
|
if (hasRequiredLib) return lib;
|
|
6452
6452
|
hasRequiredLib = 1;
|
|
6453
6453
|
|
|
6454
|
-
const prompts = requirePrompts();
|
|
6454
|
+
const prompts = requirePrompts$1();
|
|
6455
6455
|
|
|
6456
6456
|
const passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];
|
|
6457
6457
|
const noop = () => {};
|
|
@@ -6550,26 +6550,35 @@ function requireLib () {
|
|
|
6550
6550
|
return lib;
|
|
6551
6551
|
}
|
|
6552
6552
|
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6553
|
+
var prompts;
|
|
6554
|
+
var hasRequiredPrompts;
|
|
6555
|
+
|
|
6556
|
+
function requirePrompts () {
|
|
6557
|
+
if (hasRequiredPrompts) return prompts;
|
|
6558
|
+
hasRequiredPrompts = 1;
|
|
6559
|
+
function isNodeLT(tar) {
|
|
6560
|
+
tar = (Array.isArray(tar) ? tar : tar.split('.')).map(Number);
|
|
6561
|
+
let i=0, src=process.versions.node.split('.').map(Number);
|
|
6562
|
+
for (; i < tar.length; i++) {
|
|
6563
|
+
if (src[i] > tar[i]) return false;
|
|
6564
|
+
if (tar[i] > src[i]) return true;
|
|
6565
|
+
}
|
|
6566
|
+
return false;
|
|
6567
|
+
}
|
|
6562
6568
|
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6569
|
+
prompts =
|
|
6570
|
+
isNodeLT('8.6.0')
|
|
6571
|
+
? requireDist()
|
|
6572
|
+
: requireLib();
|
|
6573
|
+
return prompts;
|
|
6574
|
+
}
|
|
6567
6575
|
|
|
6568
|
-
var
|
|
6576
|
+
var promptsExports = requirePrompts();
|
|
6577
|
+
var prompt = /*@__PURE__*/getDefaultExportFromCjs(promptsExports);
|
|
6569
6578
|
|
|
6570
6579
|
var index = /*#__PURE__*/_mergeNamespaces({
|
|
6571
6580
|
__proto__: null,
|
|
6572
6581
|
default: prompt
|
|
6573
|
-
}, [
|
|
6582
|
+
}, [promptsExports]);
|
|
6574
6583
|
|
|
6575
6584
|
export { findUp as f, index as i, prompt as p };
|
|
@@ -4,7 +4,7 @@ import { distDir } from '../path.js';
|
|
|
4
4
|
import { g as getWorkerState } from './utils.Ck2hJTRs.js';
|
|
5
5
|
import { r as rpc } from './rpc.B7Mfb-Yf.js';
|
|
6
6
|
import { t as takeCoverageInsideWorker } from './coverage.zlNdAMHK.js';
|
|
7
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
7
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.DF96bIYE.js';
|
|
8
8
|
|
|
9
9
|
function setupChaiConfig(config) {
|
|
10
10
|
Object.assign(chai.config, config);
|
|
@@ -82,6 +82,7 @@ async function resolveTestRunner(config, executor) {
|
|
|
82
82
|
if (coverage) {
|
|
83
83
|
rpc().onAfterSuiteRun({
|
|
84
84
|
coverage,
|
|
85
|
+
testFiles: files.map((file) => file.name).sort(),
|
|
85
86
|
transformMode: state.environment.transformMode,
|
|
86
87
|
projectName: state.ctx.projectName
|
|
87
88
|
});
|