vitest 3.2.0 → 3.2.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/chunks/{cac.6rXCxFY1.js → cac.DId3f5oR.js} +6 -6
- package/dist/chunks/{cli-api.Cej3MBjA.js → cli-api.DYcKW0ri.js} +6 -6
- package/dist/chunks/{coverage.EIiagJJP.js → coverage.ChgzEmIc.js} +18 -13
- package/dist/chunks/{index.CIyJn3t1.js → index.CSxmp_dI.js} +1 -1
- package/dist/chunks/{index.BZ0g1JD2.js → index.CX5aIIXH.js} +7 -5
- package/dist/chunks/{reporters.d.C1ogPriE.d.ts → reporters.d.DL9pg5DB.d.ts} +3 -1
- package/dist/chunks/{vite.d.DqE4-hhK.d.ts → vite.d.CtvOcEqC.d.ts} +1 -1
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +3 -3
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/node.d.ts +10 -7
- package/dist/node.js +14 -11
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +2 -2
- package/package.json +11 -11
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import { normalize } from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import { a as defaultPort, d as defaultBrowserPort } from './constants.DnKduX2e.js';
|
|
6
|
-
import { R as ReportersMap } from './index.
|
|
6
|
+
import { R as ReportersMap } from './index.CX5aIIXH.js';
|
|
7
7
|
|
|
8
8
|
function toArr(any) {
|
|
9
9
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
|
|
|
619
619
|
|
|
620
620
|
const cac = (name = "") => new CAC(name);
|
|
621
621
|
|
|
622
|
-
var version = "3.2.
|
|
622
|
+
var version = "3.2.2";
|
|
623
623
|
|
|
624
624
|
const apiConfig = (port) => ({
|
|
625
625
|
port: {
|
|
@@ -1407,11 +1407,11 @@ async function start(mode, cliFilters, options) {
|
|
|
1407
1407
|
process.title = "node (vitest)";
|
|
1408
1408
|
} catch {}
|
|
1409
1409
|
try {
|
|
1410
|
-
const { startVitest } = await import('./cli-api.
|
|
1410
|
+
const { startVitest } = await import('./cli-api.DYcKW0ri.js').then(function (n) { return n.f; });
|
|
1411
1411
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1412
1412
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
1413
1413
|
} catch (e) {
|
|
1414
|
-
const { errorBanner } = await import('./index.
|
|
1414
|
+
const { errorBanner } = await import('./index.CX5aIIXH.js').then(function (n) { return n.u; });
|
|
1415
1415
|
console.error(`\n${errorBanner("Startup Error")}`);
|
|
1416
1416
|
console.error(e);
|
|
1417
1417
|
console.error("\n\n");
|
|
@@ -1432,7 +1432,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1432
1432
|
process.title = "node (vitest)";
|
|
1433
1433
|
} catch {}
|
|
1434
1434
|
try {
|
|
1435
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
1435
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.DYcKW0ri.js').then(function (n) { return n.f; });
|
|
1436
1436
|
const ctx = await prepareVitest(mode, {
|
|
1437
1437
|
...normalizeCliOptions(cliFilters, options),
|
|
1438
1438
|
watch: false,
|
|
@@ -1454,7 +1454,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
await ctx.close();
|
|
1456
1456
|
} catch (e) {
|
|
1457
|
-
const { errorBanner } = await import('./index.
|
|
1457
|
+
const { errorBanner } = await import('./index.CX5aIIXH.js').then(function (n) { return n.u; });
|
|
1458
1458
|
console.error(`\n${errorBanner("Collect Error")}`);
|
|
1459
1459
|
console.error(e);
|
|
1460
1460
|
console.error("\n\n");
|
|
@@ -11,9 +11,9 @@ import { generateFileHash, limitConcurrency, createFileTask, hasFailed, getTasks
|
|
|
11
11
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
12
12
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
13
13
|
import { ViteNodeServer } from 'vite-node/server';
|
|
14
|
-
import { v as version$1 } from './cac.
|
|
14
|
+
import { v as version$1 } from './cac.DId3f5oR.js';
|
|
15
15
|
import { c as createBirpc } from './index.CJ0plNrh.js';
|
|
16
|
-
import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, j as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.
|
|
16
|
+
import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, j as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.CX5aIIXH.js';
|
|
17
17
|
import require$$0$3 from 'events';
|
|
18
18
|
import require$$1$1 from 'https';
|
|
19
19
|
import require$$2 from 'http';
|
|
@@ -28,7 +28,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
|
28
28
|
import { parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
29
29
|
import crypto, { createHash } from 'node:crypto';
|
|
30
30
|
import { distDir, rootDir } from '../path.js';
|
|
31
|
-
import { h as hash, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.
|
|
31
|
+
import { h as hash, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.ChgzEmIc.js';
|
|
32
32
|
import { c as convertTasksToEvents } from './typechecker.DRKU1-1g.js';
|
|
33
33
|
import { Console } from 'node:console';
|
|
34
34
|
import c from 'tinyrainbow';
|
|
@@ -43,7 +43,7 @@ import { normalizeRequestId, cleanUrl } from 'vite-node/utils';
|
|
|
43
43
|
import { hoistMocksPlugin, automockPlugin } from '@vitest/mocker/node';
|
|
44
44
|
import { c as configDefaults } from './defaults.B7q_naMc.js';
|
|
45
45
|
import MagicString from 'magic-string';
|
|
46
|
-
import { a as BenchmarkReportsMap } from './index.
|
|
46
|
+
import { a as BenchmarkReportsMap } from './index.CSxmp_dI.js';
|
|
47
47
|
import assert$1 from 'node:assert';
|
|
48
48
|
import { serializeError } from '@vitest/utils/error';
|
|
49
49
|
import readline from 'node:readline';
|
|
@@ -5384,7 +5384,7 @@ class VitestCache {
|
|
|
5384
5384
|
}
|
|
5385
5385
|
static resolveCacheDir(root, dir, projectName) {
|
|
5386
5386
|
const baseDir = slash(dir || "node_modules/.vite");
|
|
5387
|
-
return resolve(root, baseDir, "vitest", hash("
|
|
5387
|
+
return resolve(root, baseDir, "vitest", hash("sha1", projectName || "", "hex"));
|
|
5388
5388
|
}
|
|
5389
5389
|
}
|
|
5390
5390
|
|
|
@@ -5837,7 +5837,7 @@ function MocksPlugins(options = {}) {
|
|
|
5837
5837
|
}
|
|
5838
5838
|
|
|
5839
5839
|
function generateCssFilenameHash(filepath) {
|
|
5840
|
-
return hash("
|
|
5840
|
+
return hash("sha1", filepath, "hex").slice(0, 6);
|
|
5841
5841
|
}
|
|
5842
5842
|
function generateScopedClassName(strategy, name, filename) {
|
|
5843
5843
|
// should be configured by Vite defaults
|
|
@@ -2178,47 +2178,52 @@ function unwrapYield(value, isAsync) {
|
|
|
2178
2178
|
throw new QuansyncError();
|
|
2179
2179
|
return value;
|
|
2180
2180
|
}
|
|
2181
|
-
|
|
2181
|
+
const DEFAULT_ON_YIELD = (value) => value;
|
|
2182
|
+
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
2182
2183
|
let current = generator.next();
|
|
2183
2184
|
while (!current.done) {
|
|
2184
2185
|
try {
|
|
2185
|
-
current = generator.next(unwrapYield(current.value));
|
|
2186
|
+
current = generator.next(unwrapYield(onYield(current.value, false)));
|
|
2186
2187
|
} catch (err) {
|
|
2187
2188
|
current = generator.throw(err);
|
|
2188
2189
|
}
|
|
2189
2190
|
}
|
|
2190
2191
|
return unwrapYield(current.value);
|
|
2191
2192
|
}
|
|
2192
|
-
async function iterateAsync(generator) {
|
|
2193
|
+
async function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
2193
2194
|
let current = generator.next();
|
|
2194
2195
|
while (!current.done) {
|
|
2195
2196
|
try {
|
|
2196
|
-
current = generator.next(await unwrapYield(current.value, true));
|
|
2197
|
+
current = generator.next(await unwrapYield(onYield(current.value, true), true));
|
|
2197
2198
|
} catch (err) {
|
|
2198
2199
|
current = generator.throw(err);
|
|
2199
2200
|
}
|
|
2200
2201
|
}
|
|
2201
2202
|
return current.value;
|
|
2202
2203
|
}
|
|
2203
|
-
function fromGeneratorFn(generatorFn) {
|
|
2204
|
+
function fromGeneratorFn(generatorFn, options) {
|
|
2204
2205
|
return fromObject({
|
|
2205
2206
|
name: generatorFn.name,
|
|
2206
2207
|
async(...args) {
|
|
2207
|
-
return iterateAsync(generatorFn.apply(this, args));
|
|
2208
|
+
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
|
2208
2209
|
},
|
|
2209
2210
|
sync(...args) {
|
|
2210
|
-
return iterateSync(generatorFn.apply(this, args));
|
|
2211
|
+
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
|
2211
2212
|
}
|
|
2212
2213
|
});
|
|
2213
2214
|
}
|
|
2214
|
-
function quansync$1(options) {
|
|
2215
|
-
if (isThenable(
|
|
2216
|
-
return fromPromise(
|
|
2217
|
-
if (typeof
|
|
2218
|
-
return fromGeneratorFn(options);
|
|
2215
|
+
function quansync$1(input, options) {
|
|
2216
|
+
if (isThenable(input))
|
|
2217
|
+
return fromPromise(input);
|
|
2218
|
+
if (typeof input === "function")
|
|
2219
|
+
return fromGeneratorFn(input, options);
|
|
2219
2220
|
else
|
|
2220
|
-
return fromObject(
|
|
2221
|
+
return fromObject(input);
|
|
2221
2222
|
}
|
|
2223
|
+
quansync$1({
|
|
2224
|
+
async: () => Promise.resolve(true),
|
|
2225
|
+
sync: () => false
|
|
2226
|
+
});
|
|
2222
2227
|
|
|
2223
2228
|
const quansync = quansync$1;
|
|
2224
2229
|
|
|
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import { getTasks, getFullName, getTests } from '@vitest/runner/utils';
|
|
3
3
|
import * as pathe from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
|
-
import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName } from './index.
|
|
5
|
+
import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName } from './index.CX5aIIXH.js';
|
|
6
6
|
import { stripVTControlCharacters } from 'node:util';
|
|
7
7
|
import { notNullish } from '@vitest/utils';
|
|
8
8
|
|
|
@@ -1195,9 +1195,8 @@ class DotReporter extends BaseReporter {
|
|
|
1195
1195
|
this.ctx.onClose(() => this.renderer?.stop());
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
}
|
|
1198
|
+
// Ignore default logging of base reporter
|
|
1199
|
+
printTestModule() {}
|
|
1201
1200
|
onWatcherRerun(files, trigger) {
|
|
1202
1201
|
this.tests.clear();
|
|
1203
1202
|
this.renderer?.start();
|
|
@@ -1207,7 +1206,7 @@ class DotReporter extends BaseReporter {
|
|
|
1207
1206
|
if (this.isTTY) {
|
|
1208
1207
|
const finalLog = formatTests(Array.from(this.tests.values()));
|
|
1209
1208
|
this.ctx.logger.log(finalLog);
|
|
1210
|
-
}
|
|
1209
|
+
} else this.ctx.logger.log();
|
|
1211
1210
|
this.tests.clear();
|
|
1212
1211
|
this.renderer?.finish();
|
|
1213
1212
|
super.onFinished(files, errors);
|
|
@@ -1223,9 +1222,12 @@ class DotReporter extends BaseReporter {
|
|
|
1223
1222
|
this.renderer?.schedule();
|
|
1224
1223
|
}
|
|
1225
1224
|
onTestCaseResult(test) {
|
|
1225
|
+
const result = test.result().state;
|
|
1226
|
+
// On non-TTY the finished tests are printed immediately
|
|
1227
|
+
if (!this.isTTY && result !== "pending") this.ctx.logger.outputStream.write(formatTests([result]));
|
|
1226
1228
|
super.onTestCaseResult(test);
|
|
1227
1229
|
this.finishedTests.add(test.id);
|
|
1228
|
-
this.tests.set(test.id,
|
|
1230
|
+
this.tests.set(test.id, result || "skipped");
|
|
1229
1231
|
this.renderer?.schedule();
|
|
1230
1232
|
}
|
|
1231
1233
|
onTestModuleEnd(testModule) {
|
|
@@ -951,7 +951,8 @@ declare class DotReporter extends BaseReporter {
|
|
|
951
951
|
private tests;
|
|
952
952
|
private finishedTests;
|
|
953
953
|
onInit(ctx: Vitest): void;
|
|
954
|
-
|
|
954
|
+
// Ignore default logging of base reporter
|
|
955
|
+
printTestModule(): void;
|
|
955
956
|
onWatcherRerun(files: string[], trigger?: string): void;
|
|
956
957
|
onFinished(files?: File[], errors?: unknown[]): void;
|
|
957
958
|
onTestModuleCollected(module: TestModule): void;
|
|
@@ -1071,6 +1072,7 @@ interface BrowserTesterOptions {
|
|
|
1071
1072
|
method: TestExecutionMethod;
|
|
1072
1073
|
files: string[];
|
|
1073
1074
|
providedContext: string;
|
|
1075
|
+
startTime: number;
|
|
1074
1076
|
}
|
|
1075
1077
|
|
|
1076
1078
|
type ChaiConfig = Omit<Partial<typeof chai.config>, "useProxy" | "proxyExcludedKeys">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookHandler } from 'vite';
|
|
2
|
-
import { V as Vitest, T as TestProject, b as TestProjectConfiguration, I as InlineConfig } from './reporters.d.
|
|
2
|
+
import { V as Vitest, T as TestProject, b as TestProjectConfiguration, I as InlineConfig } from './reporters.d.DL9pg5DB.js';
|
|
3
3
|
|
|
4
4
|
interface VitestPluginContext {
|
|
5
5
|
vitest: Vitest;
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as createCLI } from './chunks/cac.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.DId3f5oR.js';
|
|
2
2
|
import '@vitest/utils';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
6
|
import './chunks/constants.DnKduX2e.js';
|
|
7
|
-
import './chunks/index.
|
|
7
|
+
import './chunks/index.CX5aIIXH.js';
|
|
8
8
|
import 'node:perf_hooks';
|
|
9
9
|
import '@vitest/runner/utils';
|
|
10
10
|
import '@vitest/utils/source-map';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport, b as TestProjectConfiguration } from './chunks/reporters.d.
|
|
4
|
-
export { f as TestProjectInlineConfiguration, g as WatcherTriggerPattern, W as WorkspaceProjectConfiguration } from './chunks/reporters.d.
|
|
5
|
-
import './chunks/vite.d.
|
|
3
|
+
import { c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport, b as TestProjectConfiguration } from './chunks/reporters.d.DL9pg5DB.js';
|
|
4
|
+
export { f as TestProjectInlineConfiguration, g as WatcherTriggerPattern, W as WorkspaceProjectConfiguration } from './chunks/reporters.d.DL9pg5DB.js';
|
|
5
|
+
import './chunks/vite.d.CtvOcEqC.js';
|
|
6
6
|
import { F as FakeTimerInstallOpts } from './chunks/config.d.D2ROskhv.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import './chunks/environment.d.cL3nLXbE.js';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.DL9pg5DB.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.d.cL3nLXbE.js';
|
|
4
4
|
import '@vitest/runner';
|
package/dist/coverage.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { File as File$1, TestAnnotation, TaskResultPack as TaskResultPack$1, TaskEventPack, TaskPopulated, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, TaskBase as TaskBase$1, TaskResult as TaskResult$1, DoneCallback as DoneCallback$1, RuntimeContext as RuntimeContext$1, SuiteHooks as SuiteHooks$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, ExtendedContext, HookCleanupCallback, HookListener, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Custom as RunnerCustomCase, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskContext, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
import { S as SerializedTestSpecification, h as CoverageProvider$1, a as ReportContext$1, i as CoverageProviderModule$1, j as CoverageReporter$1, k as CoverageProviderName, l as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, m as CoverageIstanbulOptions$1, c as CoverageV8Options$1, n as CustomProviderOptions$1, o as Reporter$1, V as Vitest$1, p as BrowserScript$1, q as BrowserConfigOptions$1, r as BuiltinEnvironment$1, s as VitestEnvironment$1, P as Pool$1, t as PoolOptions$1, u as CSSModuleScopeStrategy$1, A as ApiConfig$1, v as VitestRunMode$1, D as DepsOptimizationOptions$1, w as TransformModePatterns$1, I as InlineConfig$1, x as TypecheckConfig$1, y as UserConfig$1, z as ResolvedConfig$1, E as ProjectConfig$1, U as UserWorkspaceConfig$1, F as BenchmarkUserOptions$1 } from './chunks/reporters.d.
|
|
4
|
-
export { G as BrowserTesterOptions } from './chunks/reporters.d.
|
|
3
|
+
import { S as SerializedTestSpecification, h as CoverageProvider$1, a as ReportContext$1, i as CoverageProviderModule$1, j as CoverageReporter$1, k as CoverageProviderName, l as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, m as CoverageIstanbulOptions$1, c as CoverageV8Options$1, n as CustomProviderOptions$1, o as Reporter$1, V as Vitest$1, p as BrowserScript$1, q as BrowserConfigOptions$1, r as BuiltinEnvironment$1, s as VitestEnvironment$1, P as Pool$1, t as PoolOptions$1, u as CSSModuleScopeStrategy$1, A as ApiConfig$1, v as VitestRunMode$1, D as DepsOptimizationOptions$1, w as TransformModePatterns$1, I as InlineConfig$1, x as TypecheckConfig$1, y as UserConfig$1, z as ResolvedConfig$1, E as ProjectConfig$1, U as UserWorkspaceConfig$1, F as BenchmarkUserOptions$1 } from './chunks/reporters.d.DL9pg5DB.js';
|
|
4
|
+
export { G as BrowserTesterOptions } from './chunks/reporters.d.DL9pg5DB.js';
|
|
5
5
|
import { W as WorkerContext$1 } from './chunks/worker.d.DvqK5Vmu.js';
|
|
6
6
|
import { R as RawErrsMap$1, T as TscErrorInfo$1, C as CollectLineNumbers$1, a as CollectLines$1, b as RootAndTarget$1, c as Context$1 } from './chunks/global.d.MAmajcmJ.js';
|
|
7
7
|
import { b as Awaitable$1, U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, a as EnvironmentReturn$1, V as VmEnvironmentReturn$1, E as Environment$1, R as ResolvedTestEnvironment$1, J as JSDOMOptions$1, H as HappyDOMOptions$1, f as EnvironmentOptions$1 } from './chunks/environment.d.cL3nLXbE.js';
|
|
8
8
|
export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.d.cL3nLXbE.js';
|
|
9
9
|
import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.d.tQu2eJQy.js';
|
|
10
10
|
export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.tQu2eJQy.js';
|
|
11
|
-
import './chunks/vite.d.
|
|
11
|
+
import './chunks/vite.d.CtvOcEqC.js';
|
|
12
12
|
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.D2ROskhv.js';
|
|
13
13
|
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.D2ROskhv.js';
|
|
14
14
|
import { ExpectStatic } from '@vitest/expect';
|
|
15
|
-
export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers } from '@vitest/expect';
|
|
15
|
+
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers } from '@vitest/expect';
|
|
16
16
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
17
17
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
18
18
|
import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.d.BE_2ls6u.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { z as ResolvedConfig, y as UserConfig, v as VitestRunMode, H as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, J as TestSequencer, K as TestSpecification, L as Logger, M as TestModule, N as ModuleDiagnostic } from './chunks/reporters.d.
|
|
2
|
-
export { B as BaseCoverageOptions, F as BenchmarkUserOptions, ag as BrowserBuiltinProvider, ah as BrowserCommand, ai as BrowserCommandContext, q as BrowserConfigOptions, aj as BrowserInstanceOption, ak as BrowserModuleMocker, al as BrowserOrchestrator, am as BrowserProvider, an as BrowserProviderInitializationOptions, ao as BrowserProviderModule, ap as BrowserProviderOptions, p as BrowserScript, aq as BrowserServerState, ar as BrowserServerStateSession, r as BuiltinEnvironment, as as CDPSession, u as CSSModuleScopeStrategy, m as CoverageIstanbulOptions, l as CoverageOptions, h as CoverageProvider, i as CoverageProviderModule, j as CoverageReporter, c as CoverageV8Options, n as CustomProviderOptions, D as DepsOptimizationOptions, a0 as HTMLOptions, I as InlineConfig, a2 as JUnitOptions, a1 as JsonOptions, O as OnServerRestartHandler, Q as OnTestsRerunHandler, at as ParentProjectBrowser, P as Pool, t as PoolOptions, Y as ProcessPool, au as ProjectBrowser, E as ProjectConfig, a as ReportContext, aA as ReportedHookContext, o as Reporter, ax as ResolveSnapshotPathHandler, ay as ResolveSnapshotPathHandlerContext, av as ResolvedBrowserOptions, R as ResolvedCoverageOptions, aw as ResolvedProjectConfig, $ as SerializedTestProject, a3 as TaskOptions, a4 as TestCase, a5 as TestCollection, a6 as TestDiagnostic, a7 as TestModuleState, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, aB as TestRunEndReason, az as TestRunResult, af as TestSequencerConstructor, ac as TestState, ad as TestSuite, ae as TestSuiteState, w as TransformModePatterns, x as TypecheckConfig, U as UserWorkspaceConfig, s as VitestEnvironment, X as VitestPackageInstaller, g as WatcherTriggerPattern, Z as WorkspaceSpec, _ as getFilePoolName } from './chunks/reporters.d.
|
|
3
|
-
import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1, createServer as createServer$1 } from 'vite';
|
|
1
|
+
import { z as ResolvedConfig, y as UserConfig, v as VitestRunMode, H as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, J as TestSequencer, K as TestSpecification, L as Logger, M as TestModule, N as ModuleDiagnostic } from './chunks/reporters.d.DL9pg5DB.js';
|
|
2
|
+
export { B as BaseCoverageOptions, F as BenchmarkUserOptions, ag as BrowserBuiltinProvider, ah as BrowserCommand, ai as BrowserCommandContext, q as BrowserConfigOptions, aj as BrowserInstanceOption, ak as BrowserModuleMocker, al as BrowserOrchestrator, am as BrowserProvider, an as BrowserProviderInitializationOptions, ao as BrowserProviderModule, ap as BrowserProviderOptions, p as BrowserScript, aq as BrowserServerState, ar as BrowserServerStateSession, r as BuiltinEnvironment, as as CDPSession, u as CSSModuleScopeStrategy, m as CoverageIstanbulOptions, l as CoverageOptions, h as CoverageProvider, i as CoverageProviderModule, j as CoverageReporter, c as CoverageV8Options, n as CustomProviderOptions, D as DepsOptimizationOptions, a0 as HTMLOptions, I as InlineConfig, a2 as JUnitOptions, a1 as JsonOptions, O as OnServerRestartHandler, Q as OnTestsRerunHandler, at as ParentProjectBrowser, P as Pool, t as PoolOptions, Y as ProcessPool, au as ProjectBrowser, E as ProjectConfig, a as ReportContext, aA as ReportedHookContext, o as Reporter, ax as ResolveSnapshotPathHandler, ay as ResolveSnapshotPathHandlerContext, av as ResolvedBrowserOptions, R as ResolvedCoverageOptions, aw as ResolvedProjectConfig, $ as SerializedTestProject, a3 as TaskOptions, a4 as TestCase, a5 as TestCollection, a6 as TestDiagnostic, a7 as TestModuleState, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, aB as TestRunEndReason, az as TestRunResult, af as TestSequencerConstructor, ac as TestState, ad as TestSuite, ae as TestSuiteState, w as TransformModePatterns, x as TypecheckConfig, U as UserWorkspaceConfig, s as VitestEnvironment, X as VitestPackageInstaller, g as WatcherTriggerPattern, Z as WorkspaceSpec, _ as getFilePoolName } from './chunks/reporters.d.DL9pg5DB.js';
|
|
4
3
|
import * as vite from 'vite';
|
|
4
|
+
import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1 } from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
6
6
|
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
7
7
|
import { IncomingMessage } from 'node:http';
|
|
8
8
|
import { R as RuntimeRPC } from './chunks/worker.d.tQu2eJQy.js';
|
|
9
9
|
export { T as TestExecutionType } from './chunks/worker.d.tQu2eJQy.js';
|
|
10
10
|
import { Writable } from 'node:stream';
|
|
11
|
-
export { V as VitestPluginContext } from './chunks/vite.d.
|
|
11
|
+
export { V as VitestPluginContext } from './chunks/vite.d.CtvOcEqC.js';
|
|
12
12
|
export { W as WorkerContext } from './chunks/worker.d.DvqK5Vmu.js';
|
|
13
13
|
export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.d.MAmajcmJ.js';
|
|
14
14
|
import { Debugger } from 'debug';
|
|
@@ -138,8 +138,8 @@ declare function createDebugger(namespace: `vitest:${string}`): Debugger | undef
|
|
|
138
138
|
declare const version: string;
|
|
139
139
|
|
|
140
140
|
/** @deprecated use `createViteServer` instead */
|
|
141
|
-
declare const createServer: typeof createServer
|
|
142
|
-
declare const createViteServer: typeof createServer
|
|
141
|
+
declare const createServer: typeof vite.createServer;
|
|
142
|
+
declare const createViteServer: typeof vite.createServer;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* @deprecated Use `TestModule` instead
|
|
@@ -151,5 +151,8 @@ declare const TestFile: typeof TestModule;
|
|
|
151
151
|
*/
|
|
152
152
|
type FileDiagnostic = ModuleDiagnostic;
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
// rolldownVersion is exported only by rolldown-vite
|
|
155
|
+
declare const rolldownVersion: string | undefined;
|
|
156
|
+
|
|
157
|
+
export { ApiConfig, BaseSequencer, GitNotFoundError, ModuleDiagnostic, ResolvedConfig, TestFile, TestModule, TestProject, TestSequencer, TestSpecification, FilesNotFoundError as TestsNotFoundError, UserConfig, Vitest, VitestOptions, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, startVitest, version };
|
|
155
158
|
export type { CliParseOptions, FileDiagnostic, GlobalSetupContext };
|
package/dist/node.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as vite from 'vite';
|
|
2
|
+
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
2
3
|
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
3
|
-
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.
|
|
4
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
5
|
-
export { p as parseCLI } from './chunks/cac.
|
|
6
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
7
|
-
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.DYcKW0ri.js';
|
|
5
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.DYcKW0ri.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.DId3f5oR.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.ChgzEmIc.js';
|
|
8
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.ChgzEmIc.js';
|
|
8
9
|
import { slash, deepClone } from '@vitest/utils';
|
|
9
10
|
import { f as findUp } from './chunks/index.X0nbfr6-.js';
|
|
10
11
|
import { resolve } from 'pathe';
|
|
@@ -19,7 +20,7 @@ import '@vitest/snapshot/manager';
|
|
|
19
20
|
import 'vite-node/client';
|
|
20
21
|
import 'vite-node/server';
|
|
21
22
|
import './chunks/index.CJ0plNrh.js';
|
|
22
|
-
import './chunks/index.
|
|
23
|
+
import './chunks/index.CX5aIIXH.js';
|
|
23
24
|
import 'node:perf_hooks';
|
|
24
25
|
import '@vitest/utils/source-map';
|
|
25
26
|
import 'tinyrainbow';
|
|
@@ -52,7 +53,7 @@ import 'vite-node/utils';
|
|
|
52
53
|
import '@vitest/mocker/node';
|
|
53
54
|
import './chunks/defaults.B7q_naMc.js';
|
|
54
55
|
import 'magic-string';
|
|
55
|
-
import './chunks/index.
|
|
56
|
+
import './chunks/index.CSxmp_dI.js';
|
|
56
57
|
import 'node:assert';
|
|
57
58
|
import '@vitest/utils/error';
|
|
58
59
|
import 'node:readline';
|
|
@@ -92,11 +93,13 @@ function createDebugger(namespace) {
|
|
|
92
93
|
|
|
93
94
|
const version = Vitest.version;
|
|
94
95
|
/** @deprecated use `createViteServer` instead */
|
|
95
|
-
const createServer = createServer
|
|
96
|
-
const createViteServer = createServer
|
|
96
|
+
const createServer = vite.createServer;
|
|
97
|
+
const createViteServer = vite.createServer;
|
|
97
98
|
/**
|
|
98
99
|
* @deprecated Use `TestModule` instead
|
|
99
100
|
*/
|
|
100
101
|
const TestFile = TestModule;
|
|
102
|
+
// rolldownVersion is exported only by rolldown-vite
|
|
103
|
+
const rolldownVersion = vite.rolldownVersion;
|
|
101
104
|
|
|
102
|
-
export { TestFile, VitestPlugin, createDebugger, createServer, createViteServer, resolveConfig, version };
|
|
105
|
+
export { TestFile, VitestPlugin, createDebugger, createServer, createViteServer, resolveConfig, rolldownVersion, version };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aQ as BaseReporter, aC as BasicReporter, aR as BenchmarkBuiltinReporters, aD as BenchmarkReporter, aE as BenchmarkReportsMap, aS as BuiltinReporterOptions, aT as BuiltinReporters, aF as DefaultReporter, aG as DotReporter, aH as GithubActionsReporter, aI as HangingProcessReporter, aK as JUnitReporter, aU as JsonAssertionResult, aJ as JsonReporter, aV as JsonTestResult, aW as JsonTestResults, aA as ReportedHookContext, o as Reporter, aL as ReportersMap, aM as TapFlatReporter, aN as TapReporter, aB as TestRunEndReason, aO as VerboseBenchmarkReporter, aP as VerboseReporter } from './chunks/reporters.d.
|
|
1
|
+
export { aQ as BaseReporter, aC as BasicReporter, aR as BenchmarkBuiltinReporters, aD as BenchmarkReporter, aE as BenchmarkReportsMap, aS as BuiltinReporterOptions, aT as BuiltinReporters, aF as DefaultReporter, aG as DotReporter, aH as GithubActionsReporter, aI as HangingProcessReporter, aK as JUnitReporter, aU as JsonAssertionResult, aJ as JsonReporter, aV as JsonTestResult, aW as JsonTestResults, aA as ReportedHookContext, o as Reporter, aL as ReportersMap, aM as TapFlatReporter, aN as TapReporter, aB as TestRunEndReason, aO as VerboseBenchmarkReporter, aP as VerboseReporter } from './chunks/reporters.d.DL9pg5DB.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import './chunks/environment.d.cL3nLXbE.js';
|
|
4
4
|
import 'vitest/optional-types.js';
|
package/dist/reporters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BasicReporter, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
1
|
+
export { B as BasicReporter, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.CX5aIIXH.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CSxmp_dI.js';
|
|
3
3
|
import 'node:perf_hooks';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
import '@vitest/utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.2",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
|
|
120
120
|
"happy-dom": "*",
|
|
121
121
|
"jsdom": "*",
|
|
122
|
-
"@vitest/
|
|
123
|
-
"@vitest/
|
|
122
|
+
"@vitest/browser": "3.2.2",
|
|
123
|
+
"@vitest/ui": "3.2.2"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
126
126
|
"@edge-runtime/vm": {
|
|
@@ -161,14 +161,14 @@
|
|
|
161
161
|
"tinyrainbow": "^2.0.0",
|
|
162
162
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
|
|
163
163
|
"why-is-node-running": "^2.3.0",
|
|
164
|
-
"@vitest/
|
|
165
|
-
"@vitest/
|
|
166
|
-
"@vitest/runner": "3.2.
|
|
167
|
-
"@vitest/
|
|
168
|
-
"@vitest/
|
|
169
|
-
"@vitest/
|
|
170
|
-
"@vitest/mocker": "3.2.
|
|
171
|
-
"vite-node": "3.2.
|
|
164
|
+
"@vitest/pretty-format": "^3.2.2",
|
|
165
|
+
"@vitest/snapshot": "3.2.2",
|
|
166
|
+
"@vitest/runner": "3.2.2",
|
|
167
|
+
"@vitest/spy": "3.2.2",
|
|
168
|
+
"@vitest/utils": "3.2.2",
|
|
169
|
+
"@vitest/expect": "3.2.2",
|
|
170
|
+
"@vitest/mocker": "3.2.2",
|
|
171
|
+
"vite-node": "3.2.2"
|
|
172
172
|
},
|
|
173
173
|
"devDependencies": {
|
|
174
174
|
"@ampproject/remapping": "^2.3.0",
|