vitest 4.1.5 → 5.0.0-beta.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/LICENSE.md +7 -0
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +4 -4
- package/dist/chunks/{base.RR7zL1h0.js → base.Opc_YHkk.js} +10 -11
- package/dist/chunks/browser.d.BUhkKcDl.d.ts +899 -0
- package/dist/chunks/{cac.DJJmV0dT.js → cac.8N4bOkkB.js} +23 -11
- package/dist/chunks/{cli-api.Cjt90eJu.js → cli-api.B0RFke2g.js} +5799 -353
- package/dist/chunks/{config.d.A1h_Y6Jt.d.ts → config.d.D91DHYaD.d.ts} +11 -3
- package/dist/chunks/{console.3WNpx0tS.js → console.B3IRP8fX.js} +3 -1
- package/dist/chunks/{constants.CPYnjOGj.js → constants.-juJ8b_4.js} +1 -1
- package/dist/chunks/{coverage.d.BZtK59WP.d.ts → coverage.d.g2xbl2sP.d.ts} +4 -0
- package/dist/chunks/{creator.DgVhQm5q.js → creator.BqL2U_x4.js} +1 -1
- package/dist/chunks/{defaults.9aQKnqFk.js → defaults.szbHWQun.js} +4 -2
- package/dist/chunks/environment.d-DOJxxZV9.d.DOJxxZV9.d.ts +17 -0
- package/dist/chunks/general.d.DFAHgpC2.d.ts +247 -0
- package/dist/chunks/{global.d.DVsSRdQ5.d.ts → global.d.DhbKSQoV.d.ts} +4 -5
- package/dist/chunks/{globals.Dj1TGiMC.js → globals.EHmmu0nC.js} +15 -14
- package/dist/chunks/{index.DXx9Dtk7.js → index.CViWo__T.js} +5 -5
- package/dist/chunks/{startVitestModuleRunner.bRl2_oI_.js → index.CbgUM9E5.js} +731 -5
- package/dist/chunks/{test.DNmyFkvJ.js → index.D_7-4CaB.js} +2659 -14
- package/dist/chunks/{init-forks.UV3ZQGQH.js → init-forks.DMge3WTt.js} +1 -1
- package/dist/chunks/{init-threads.D3eCsY76.js → init-threads.eIoyCTon.js} +1 -1
- package/dist/chunks/{init.D98-gwRW.js → init.BVd7SaCA.js} +3 -5
- package/dist/chunks/{nativeModuleMocker.BRN2oBJd.js → nativeModuleMocker.DKpFw0pk.js} +3 -2
- package/dist/chunks/{index.BCY_7LL2.js → nativeModuleRunner.BOeMnHl4.js} +43 -12
- package/dist/chunks/node.CwFbQqI1.js +47 -0
- package/dist/chunks/{reporters.d.CEnv6XRv.d.ts → plugin.d.cIKZEZ16.d.ts} +306 -19
- package/dist/chunks/plugins.DrsmdUE2.js +37 -0
- package/dist/chunks/{rpc.MzXet3jl.js → rpc.DFRWVnRh.js} +16 -1
- package/dist/chunks/{rpc.d.B_8sPU0w.d.ts → rpc.d.7JZuxZ8u.d.ts} +19 -3
- package/dist/chunks/{setup-common.DYx3LtFI.js → setup-common.Hpq30zVk.js} +7 -3
- package/dist/chunks/{utils.BS4fH3nR.js → utils.DKODp04v.js} +3 -4
- package/dist/chunks/{vm.DVLYObm9.js → vm.2okbRRME.js} +6 -6
- package/dist/chunks/{worker.d.ZpHpO4yb.d.ts → worker.d.Bu1kXGw4.d.ts} +3 -3
- package/dist/cli.js +2 -2
- package/dist/config.cjs +4 -2
- package/dist/config.d.ts +21 -18
- package/dist/config.js +2 -2
- package/dist/index.d.ts +84 -22
- package/dist/index.js +15 -13
- package/dist/module-evaluator.d.ts +5 -3
- package/dist/module-evaluator.js +1 -1
- package/dist/node.d.ts +114 -19
- package/dist/node.js +21 -26
- package/dist/runtime.d.ts +40 -4
- package/dist/runtime.js +5 -6
- package/dist/{chunks/traces.DT5aQ62U.js → traces.js} +1 -1
- package/dist/worker.d.ts +5 -5
- package/dist/worker.js +21 -23
- package/dist/workers/forks.js +21 -23
- package/dist/workers/runVmTests.js +17 -16
- package/dist/workers/threads.js +21 -23
- package/dist/workers/vmForks.js +7 -9
- package/dist/workers/vmThreads.js +7 -9
- package/package.json +21 -38
- package/dist/chunks/benchmark.CX_oY03V.js +0 -40
- package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +0 -24
- package/dist/chunks/browser.d.BcoexmFG.d.ts +0 -62
- package/dist/chunks/coverage.DM_a_rWm.js +0 -1087
- package/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -17
- package/dist/chunks/index.DC7d2Pf8.js +0 -729
- package/dist/chunks/index.DdgEv5B1.js +0 -42
- package/dist/chunks/index.UpGiHP7g.js +0 -4255
- package/dist/chunks/nativeModuleRunner.BIakptoF.js +0 -36
- package/dist/chunks/node.COQbm6gK.js +0 -14
- package/dist/chunks/plugin.d.BM2TCi12.d.ts +0 -38
- package/dist/chunks/suite.d.udJtyAgw.d.ts +0 -10
- package/dist/chunks/traces.d.D2T_R8rx.d.ts +0 -60
- package/dist/coverage.d.ts +0 -123
- package/dist/coverage.js +0 -27
- package/dist/environments.d.ts +0 -22
- package/dist/environments.js +0 -5
- package/dist/reporters.d.ts +0 -27
- package/dist/reporters.js +0 -26
- package/dist/runners.d.ts +0 -70
- package/dist/runners.js +0 -19
- package/dist/snapshot.d.ts +0 -9
- package/dist/snapshot.js +0 -6
- package/dist/suite.d.ts +0 -5
- package/dist/suite.js +0 -8
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
2
|
import vm, { isContext, runInContext } from 'node:vm';
|
|
3
3
|
import { dirname, basename, extname, normalize, resolve } from 'pathe';
|
|
4
|
-
import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.
|
|
4
|
+
import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.BVd7SaCA.js';
|
|
5
5
|
import { distDir } from '../path.js';
|
|
6
|
-
import { createCustomConsole } from './console.
|
|
7
|
-
import
|
|
6
|
+
import { createCustomConsole } from './console.B3IRP8fX.js';
|
|
7
|
+
import fs__default from 'node:fs';
|
|
8
8
|
import { createRequire, Module, isBuiltin } from 'node:module';
|
|
9
9
|
import { toArray, splitFileAndPostfix, isBareImport } from '@vitest/utils/helpers';
|
|
10
10
|
import { findNearestPackageData } from '@vitest/utils/resolver';
|
|
11
11
|
import { dirname as dirname$1 } from 'node:path';
|
|
12
12
|
import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
|
|
13
13
|
import { getDefaultRequestStubs } from '../module-evaluator.js';
|
|
14
|
-
import { s as startVitestModuleRunner, V as VITEST_VM_CONTEXT_SYMBOL, c as createNodeImportMeta } from './
|
|
14
|
+
import { s as startVitestModuleRunner, V as VITEST_VM_CONTEXT_SYMBOL, c as createNodeImportMeta } from './index.CbgUM9E5.js';
|
|
15
15
|
import { p as provideWorkerState } from './utils.BX5Fg8C4.js';
|
|
16
16
|
|
|
17
17
|
function interopCommonJsModule(interopDefault, mod) {
|
|
@@ -551,7 +551,7 @@ class ViteExecutor {
|
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
-
const { existsSync } =
|
|
554
|
+
const { existsSync } = fs__default;
|
|
555
555
|
// always defined when we use vm pool
|
|
556
556
|
const nativeResolve = import.meta.resolve;
|
|
557
557
|
// TODO: improve Node.js strict mode support in #2854
|
|
@@ -675,7 +675,7 @@ class ExternalModulesExecutor {
|
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
const { promises, readFileSync } =
|
|
678
|
+
const { promises, readFileSync } = fs__default;
|
|
679
679
|
class FileMap {
|
|
680
680
|
fsCache = /* @__PURE__ */ new Map();
|
|
681
681
|
fsBufferCache = /* @__PURE__ */ new Map();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FileSpecification, Task, CancelReason } from '@vitest/runner';
|
|
2
2
|
import { EvaluatedModules } from 'vite/module-runner';
|
|
3
|
-
import {
|
|
3
|
+
import { a as SerializedConfig } from './config.d.D91DHYaD.js';
|
|
4
4
|
import { E as Environment } from './environment.d.CrsxCzP1.js';
|
|
5
|
-
import {
|
|
5
|
+
import { a as RuntimeRPC, R as RunnerRPC } from './rpc.d.7JZuxZ8u.js';
|
|
6
6
|
|
|
7
7
|
//#region src/messages.d.ts
|
|
8
8
|
declare const TYPE_REQUEST: "q";
|
|
@@ -252,4 +252,4 @@ interface WorkerGlobalState {
|
|
|
252
252
|
onFilterStackTrace?: (trace: string) => string;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
export type {
|
|
255
|
+
export type { BirpcReturn as B, ContextRPC as C, TestExecutionMethod as T, WorkerGlobalState as W, ContextTestEnvironment as a, WorkerExecuteContext as b, WorkerTestEnvironment as c, WorkerSetupContext as d, BirpcOptions as e };
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as createCLI } from './chunks/cac.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.8N4bOkkB.js';
|
|
2
2
|
import '@vitest/utils/helpers';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
6
|
import './chunks/env.D4Lgay0q.js';
|
|
7
7
|
import 'std-env';
|
|
8
|
-
import './chunks/constants.
|
|
8
|
+
import './chunks/constants.-juJ8b_4.js';
|
|
9
9
|
import 'node:assert';
|
|
10
10
|
|
|
11
11
|
createCLI().parse();
|
package/dist/config.cjs
CHANGED
|
@@ -39,7 +39,8 @@ const coverageConfigDefaults = {
|
|
|
39
39
|
functions: [50, 80],
|
|
40
40
|
branches: [50, 80],
|
|
41
41
|
lines: [50, 80]
|
|
42
|
-
}
|
|
42
|
+
},
|
|
43
|
+
autoAttachSubprocess: false
|
|
43
44
|
};
|
|
44
45
|
const fakeTimersDefaults = {
|
|
45
46
|
loopLimit: 1e4,
|
|
@@ -61,7 +62,7 @@ const configDefaults = Object.freeze({
|
|
|
61
62
|
teardownTimeout: 1e4,
|
|
62
63
|
forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
|
|
63
64
|
update: false,
|
|
64
|
-
reporters: [],
|
|
65
|
+
reporters: [stdEnv.isAgent ? "minimal" : "default", ...process.env.GITHUB_ACTIONS === "true" ? ["github-actions"] : []],
|
|
65
66
|
silent: false,
|
|
66
67
|
hideSkippedTests: false,
|
|
67
68
|
api: false,
|
|
@@ -79,6 +80,7 @@ const configDefaults = Object.freeze({
|
|
|
79
80
|
exclude: defaultExclude
|
|
80
81
|
},
|
|
81
82
|
slowTestThreshold: 300,
|
|
83
|
+
taskTitleValueFormatTruncate: 40,
|
|
82
84
|
disableConsoleIntercept: false,
|
|
83
85
|
detectAsyncLeaks: false
|
|
84
86
|
});
|
package/dist/config.d.ts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { HookHandler, UserConfig, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
3
|
+
import { a4 as InlineConfig, aW as VitestPluginContext, N as CoverageOptions, a$ as FieldsWithDefaultValues, aR as UserWorkspaceConfig, b0 as UserProjectConfigFn, b1 as UserProjectConfigExport } from './chunks/plugin.d.cIKZEZ16.js';
|
|
4
|
+
export { b2 as TestProjectConfiguration, b3 as TestProjectInlineConfiguration, U as TestUserConfig, aX as WatcherTriggerPattern } from './chunks/plugin.d.cIKZEZ16.js';
|
|
5
|
+
import { F as FakeTimerInstallOpts } from './chunks/config.d.D91DHYaD.js';
|
|
6
|
+
import './chunks/browser.d.BUhkKcDl.js';
|
|
7
7
|
export { TestTagDefinition } from '@vitest/runner';
|
|
8
8
|
import '@vitest/utils';
|
|
9
|
-
import './chunks/traces.d.D2T_R8rx.js';
|
|
10
9
|
import 'node:stream';
|
|
11
|
-
import './chunks/
|
|
12
|
-
import './chunks/worker.d.ZpHpO4yb.js';
|
|
13
|
-
import 'vite/module-runner';
|
|
14
|
-
import './chunks/environment.d.CrsxCzP1.js';
|
|
15
|
-
import './chunks/rpc.d.B_8sPU0w.js';
|
|
16
|
-
import '@vitest/snapshot';
|
|
10
|
+
import './chunks/general.d.DFAHgpC2.js';
|
|
17
11
|
import '@vitest/pretty-format';
|
|
12
|
+
import './chunks/environment.d-DOJxxZV9.d.DOJxxZV9.js';
|
|
13
|
+
import 'node:fs/promises';
|
|
14
|
+
import '@vitest/runner/types';
|
|
18
15
|
import '@vitest/utils/diff';
|
|
19
|
-
import '
|
|
16
|
+
import 'chai';
|
|
20
17
|
import 'vitest/optional-types.js';
|
|
21
|
-
import './chunks/
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
18
|
+
import './chunks/worker.d.Bu1kXGw4.js';
|
|
19
|
+
import 'vite/module-runner';
|
|
20
|
+
import './chunks/environment.d.CrsxCzP1.js';
|
|
21
|
+
import './chunks/rpc.d.7JZuxZ8u.js';
|
|
24
22
|
import '@vitest/mocker';
|
|
25
23
|
import '@vitest/utils/source-map';
|
|
26
24
|
import 'vitest/browser';
|
|
27
|
-
import './chunks/coverage.d.
|
|
28
|
-
import '@vitest/snapshot/manager';
|
|
25
|
+
import './chunks/coverage.d.g2xbl2sP.js';
|
|
29
26
|
import 'node:console';
|
|
30
27
|
import 'node:fs';
|
|
28
|
+
import '@vitest/spy';
|
|
29
|
+
import 'tinyrainbow';
|
|
30
|
+
import '@vitest/utils/display';
|
|
31
|
+
import '@vitest/runner/utils';
|
|
32
|
+
import 'tinybench';
|
|
31
33
|
|
|
32
34
|
type VitestInlineConfig = InlineConfig;
|
|
33
35
|
declare module "vite" {
|
|
@@ -63,7 +65,7 @@ declare const configDefaults: Readonly<{
|
|
|
63
65
|
teardownTimeout: number;
|
|
64
66
|
forceRerunTriggers: string[];
|
|
65
67
|
update: boolean;
|
|
66
|
-
reporters:
|
|
68
|
+
reporters: string[];
|
|
67
69
|
silent: boolean;
|
|
68
70
|
hideSkippedTests: boolean;
|
|
69
71
|
api: boolean;
|
|
@@ -83,6 +85,7 @@ declare const configDefaults: Readonly<{
|
|
|
83
85
|
exclude: string[];
|
|
84
86
|
};
|
|
85
87
|
slowTestThreshold: number;
|
|
88
|
+
taskTitleValueFormatTruncate: number;
|
|
86
89
|
disableConsoleIntercept: boolean;
|
|
87
90
|
detectAsyncLeaks: boolean;
|
|
88
91
|
}>;
|
package/dist/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.
|
|
1
|
+
export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.szbHWQun.js';
|
|
2
2
|
export { mergeConfig } from 'vite';
|
|
3
|
-
export { d as defaultBrowserPort } from './chunks/constants.
|
|
3
|
+
export { d as defaultBrowserPort } from './chunks/constants.-juJ8b_4.js';
|
|
4
4
|
import 'node:os';
|
|
5
5
|
import './chunks/env.D4Lgay0q.js';
|
|
6
6
|
import 'std-env';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as
|
|
2
|
-
export {
|
|
3
|
-
import './chunks/global.d.
|
|
4
|
-
import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, TaskPopulated } from '@vitest/runner';
|
|
5
|
-
export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, 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, SuiteOptions, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, VitestRunnerConfig as TestRunnerConfig, TestTags, VitestRunner as VitestTestRunner, afterAll, afterEach, aroundAll, aroundEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
1
|
+
import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, E as ExpectStatic, a as MatcherState, b as SyncExpectationResult, A as AsyncExpectationResult, c as ExpectationResult, B as BenchFunction, d as BenchmarkAPI, e as ModuleDefinitionDiagnostic, f as ModuleDefinitionLocation, g as SourceModuleDiagnostic, h as SourceModuleLocations } from './chunks/browser.d.BUhkKcDl.js';
|
|
2
|
+
export { i as Assertion, j as AsymmetricMatchersContaining, k as Benchmark, l as BenchmarkResult, m as BrowserTesterOptions, D as DeeplyAllowMatchers, J as JestAssertion, R as Matcher, n as Matchers, o as MatchersObject } from './chunks/browser.d.BUhkKcDl.js';
|
|
3
|
+
import './chunks/global.d.DhbKSQoV.js';
|
|
4
|
+
import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, TaskPopulated, VitestRunner, VitestRunnerImportSource, Suite, Task, CancelReason, TestContext, ImportDuration, createTaskCollector, getCurrentSuite, getCurrentTest, getHooks, getFn } from '@vitest/runner';
|
|
5
|
+
export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, 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, SuiteOptions, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, VitestRunnerConfig as TestRunnerConfig, TestTagDefinition, TestTags, VitestRunner as VitestTestRunner, afterAll, afterEach, aroundAll, aroundEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
6
6
|
import { Awaitable } from '@vitest/utils';
|
|
7
7
|
export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
8
|
-
import {
|
|
9
|
-
export { C as ContextRPC,
|
|
10
|
-
import {
|
|
11
|
-
export {
|
|
12
|
-
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/
|
|
13
|
-
export {
|
|
14
|
-
import { ExpectStatic, MatcherState, SyncExpectationResult, AsyncExpectationResult, ExpectationResult } from '@vitest/expect';
|
|
15
|
-
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, RawMatcherFn as Matcher, ExpectationResult as MatcherResult, MatcherState, Matchers, chai } from '@vitest/expect';
|
|
16
|
-
import { DomainSnapshotAdapter } from '@vitest/snapshot';
|
|
17
|
-
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
8
|
+
import { B as BirpcReturn } from './chunks/worker.d.Bu1kXGw4.js';
|
|
9
|
+
export { C as ContextRPC, a as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.Bu1kXGw4.js';
|
|
10
|
+
import { S as SerializedRootConfig, F as FakeTimerInstallOpts, R as RuntimeOptions, a as SerializedConfig } from './chunks/config.d.D91DHYaD.js';
|
|
11
|
+
export { b as RuntimeConfig, c as SerializedCoverageConfig } from './chunks/config.d.D91DHYaD.js';
|
|
12
|
+
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext, D as DomainSnapshotAdapter } from './chunks/general.d.DFAHgpC2.js';
|
|
13
|
+
export { A as AfterSuiteRunMeta, a as DomainMatchResult, S as SnapshotData, b as SnapshotMatchOptions, c as SnapshotResult, d as SnapshotSerializer, e as SnapshotStateOptions, f as SnapshotSummary, g as SnapshotUpdateState, h as UncheckedSnapshot } from './chunks/general.d.DFAHgpC2.js';
|
|
18
14
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
19
15
|
export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
20
16
|
import { Disposable } from 'vitest/optional-runtime-types.js';
|
|
21
17
|
import { ModuleMockFactoryWithHelper, ModuleMockOptions } from '@vitest/mocker';
|
|
22
|
-
|
|
18
|
+
import * as tinybench from 'tinybench';
|
|
19
|
+
import { Options } from 'tinybench';
|
|
20
|
+
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
|
|
23
21
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
24
|
-
|
|
25
|
-
export {
|
|
22
|
+
import { T as Traces } from './chunks/rpc.d.7JZuxZ8u.js';
|
|
23
|
+
export { R as RunnerRPC, a as RuntimeRPC } from './chunks/rpc.d.7JZuxZ8u.js';
|
|
24
|
+
import { createChainable, matchesTags } from '@vitest/runner/utils';
|
|
26
25
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
27
|
-
export { a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.B_8sPU0w.js';
|
|
28
26
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
29
|
-
|
|
27
|
+
import * as chai from 'chai';
|
|
28
|
+
export { chai };
|
|
29
|
+
import 'tinyrainbow';
|
|
30
|
+
import '@vitest/utils/display';
|
|
30
31
|
import '@vitest/pretty-format';
|
|
31
32
|
import 'vite/module-runner';
|
|
32
33
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
33
|
-
import '
|
|
34
|
+
import './chunks/environment.d-DOJxxZV9.d.DOJxxZV9.js';
|
|
34
35
|
|
|
35
36
|
interface SourceMap {
|
|
36
37
|
file: string;
|
|
@@ -624,6 +625,67 @@ interface VitestUtils {
|
|
|
624
625
|
declare const vitest: VitestUtils;
|
|
625
626
|
declare const vi: VitestUtils;
|
|
626
627
|
|
|
628
|
+
declare function getBenchOptions(key: Test): Options;
|
|
629
|
+
declare function getBenchFn(key: Test): BenchFunction;
|
|
630
|
+
declare const bench: BenchmarkAPI;
|
|
631
|
+
|
|
632
|
+
declare class NodeBenchmarkRunner implements VitestRunner {
|
|
633
|
+
config: SerializedConfig;
|
|
634
|
+
private moduleRunner;
|
|
635
|
+
constructor(config: SerializedConfig);
|
|
636
|
+
importTinybench(): Promise<typeof tinybench>;
|
|
637
|
+
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
638
|
+
runSuite(suite: Suite): Promise<void>;
|
|
639
|
+
runTask(): Promise<void>;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
declare class TestRunner implements VitestRunner {
|
|
643
|
+
config: SerializedConfig;
|
|
644
|
+
private snapshotClient;
|
|
645
|
+
private workerState;
|
|
646
|
+
private moduleRunner;
|
|
647
|
+
private cancelRun;
|
|
648
|
+
private assertionsErrors;
|
|
649
|
+
pool: string;
|
|
650
|
+
private _otel;
|
|
651
|
+
viteEnvironment: string;
|
|
652
|
+
private viteModuleRunner;
|
|
653
|
+
constructor(config: SerializedConfig);
|
|
654
|
+
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
655
|
+
onCollectStart(file: File): void;
|
|
656
|
+
onCleanupWorkerContext(listener: () => unknown): void;
|
|
657
|
+
onAfterRunFiles(): void;
|
|
658
|
+
onAfterRunSuite(suite: Suite): Promise<void>;
|
|
659
|
+
onAfterRunTask(test: Task): void;
|
|
660
|
+
cancel(_reason: CancelReason): void;
|
|
661
|
+
injectValue(key: string): any;
|
|
662
|
+
onBeforeRunTask(test: Task): Promise<void>;
|
|
663
|
+
onBeforeRunSuite(suite: Suite): Promise<void>;
|
|
664
|
+
onBeforeTryTask(test: Task): void;
|
|
665
|
+
onAfterTryTask(test: Test): void;
|
|
666
|
+
extendTaskContext(context: TestContext): TestContext;
|
|
667
|
+
getImportDurations(): Record<string, ImportDuration>;
|
|
668
|
+
trace: <T>(name: string, attributes: Record<string, any> | (() => T), cb?: () => T) => T;
|
|
669
|
+
__setTraces(traces: Traces): void;
|
|
670
|
+
static createTaskCollector: typeof createTaskCollector;
|
|
671
|
+
static getCurrentSuite: typeof getCurrentSuite;
|
|
672
|
+
static getCurrentTest: typeof getCurrentTest;
|
|
673
|
+
static createChainable: typeof createChainable;
|
|
674
|
+
static getSuiteHooks: typeof getHooks;
|
|
675
|
+
static getTestFn: typeof getFn;
|
|
676
|
+
static setSuiteHooks: typeof getHooks;
|
|
677
|
+
static setTestFn: typeof getFn;
|
|
678
|
+
static matchesTags: typeof matchesTags;
|
|
679
|
+
/**
|
|
680
|
+
* @deprecated
|
|
681
|
+
*/
|
|
682
|
+
static getBenchFn: typeof getBenchFn;
|
|
683
|
+
/**
|
|
684
|
+
* @deprecated
|
|
685
|
+
*/
|
|
686
|
+
static getBenchOptions: typeof getBenchOptions;
|
|
687
|
+
}
|
|
688
|
+
|
|
627
689
|
interface AssertType {
|
|
628
690
|
<T>(value: T): void;
|
|
629
691
|
}
|
|
@@ -638,5 +700,5 @@ declare namespace Experimental {
|
|
|
638
700
|
export { ModuleDefinitionDiagnostic, ModuleDefinitionDurationsDiagnostic, ModuleDefinitionLocation, SourceModuleDiagnostic, SourceModuleLocations, UntrackedModuleDefinitionDiagnostic };
|
|
639
701
|
}
|
|
640
702
|
|
|
641
|
-
export { Experimental, LabelColor, ModuleGraphData, ProvidedContext, SerializedRootConfig, SerializedTestSpecification, Snapshots, UserConsoleLog, assert, assertType, createExpect, globalExpect as expect, inject, should, vi, vitest };
|
|
703
|
+
export { AsyncExpectationResult as AsyncMatcherResult, BenchFunction, BenchmarkAPI, NodeBenchmarkRunner as BenchmarkRunner, DomainSnapshotAdapter, ExpectStatic, Experimental, LabelColor, ExpectationResult as MatcherResult, MatcherState, ModuleGraphData, ProvidedContext, SerializedConfig, SerializedRootConfig, SerializedTestSpecification, Snapshots, SyncExpectationResult as SyncMatcherResult, TestRunner, UserConsoleLog, assert, assertType, bench, createExpect, globalExpect as expect, inject, should, vi, vitest };
|
|
642
704
|
export type { AssertType, BrowserUI, ExternalResult, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
export { N as BenchmarkRunner, S as Snapshots, T as TestRunner, a as assert, c as createExpect, g as expect,
|
|
2
|
-
export {
|
|
3
|
-
export { V as EvaluatedModules } from './chunks/evaluatedModules.Dg1zASAC.js';
|
|
4
|
-
export { a as assertType } from './chunks/index.DdgEv5B1.js';
|
|
1
|
+
export { N as BenchmarkRunner, S as Snapshots, T as TestRunner, a as assert, b as assertType, c as bench, d as createExpect, g as expect, e as inject, s as should, v as vi, f as vitest } from './chunks/index.D_7-4CaB.js';
|
|
2
|
+
export { V as EvaluatedModules } from './chunks/rpc.DFRWVnRh.js';
|
|
5
3
|
export { expectTypeOf } from 'expect-type';
|
|
6
4
|
export { afterAll, afterEach, aroundAll, aroundEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import '@vitest/utils/timers';
|
|
5
|
+
import * as chai from 'chai';
|
|
6
|
+
export { chai };
|
|
10
7
|
import './chunks/utils.BX5Fg8C4.js';
|
|
11
|
-
import '@vitest/
|
|
12
|
-
import '@vitest/utils/error';
|
|
13
|
-
import 'pathe';
|
|
8
|
+
import '@vitest/utils/timers';
|
|
14
9
|
import '@vitest/spy';
|
|
10
|
+
import '@vitest/utils/helpers';
|
|
15
11
|
import '@vitest/utils/offset';
|
|
16
12
|
import '@vitest/utils/source-map';
|
|
17
13
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
14
|
+
import '@vitest/runner/utils';
|
|
15
|
+
import '@vitest/utils/error';
|
|
16
|
+
import './chunks/plugins.DrsmdUE2.js';
|
|
17
|
+
import '@vitest/pretty-format';
|
|
18
|
+
import '@vitest/utils/diff';
|
|
19
|
+
import '@vitest/utils/display';
|
|
20
|
+
import 'tinyrainbow';
|
|
21
|
+
import 'pathe';
|
|
21
22
|
import 'vite/module-runner';
|
|
23
|
+
import './chunks/index.Chj8NDwU.js';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode } from 'vite/module-runner';
|
|
2
2
|
import { V as VitestEvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
3
3
|
import vm from 'node:vm';
|
|
4
|
-
import {
|
|
4
|
+
import { a as RuntimeRPC } from './chunks/rpc.d.7JZuxZ8u.js';
|
|
5
5
|
import '@vitest/runner';
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
6
|
+
import './chunks/general.d.DFAHgpC2.js';
|
|
7
|
+
import '@vitest/pretty-format';
|
|
8
|
+
import '@vitest/utils';
|
|
9
|
+
import './chunks/environment.d-DOJxxZV9.d.DOJxxZV9.js';
|
|
8
10
|
|
|
9
11
|
type ModuleExecutionInfo = Map<string, ModuleExecutionInfoEntry>;
|
|
10
12
|
interface ModuleExecutionInfoEntry {
|
package/dist/module-evaluator.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isBuiltin, createRequire } from 'node:module';
|
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
3
3
|
import vm from 'node:vm';
|
|
4
4
|
import { ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey } from 'vite/module-runner';
|
|
5
|
-
import {
|
|
5
|
+
import { Traces } from './traces.js';
|
|
6
6
|
|
|
7
7
|
const performanceNow = performance.now.bind(performance);
|
|
8
8
|
class ModuleDebug {
|
package/dist/node.d.ts
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, ViteDevServer, LogLevel, LoggerOptions, Logger as Logger$1 } from 'vite';
|
|
2
|
+
import { InlineConfig, UserConfig as UserConfig$1, TransformResult, Plugin, ResolvedConfig as ResolvedConfig$1, ViteDevServer, LogLevel, LoggerOptions, Logger as Logger$1 } from 'vite';
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import { R as ResolvedConfig,
|
|
7
|
-
export { M as AgentReporter, B as BaseCoverageOptions,
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { R as ResolvedConfig, U as UserConfig, V as VitestRunMode, a as VitestOptions, b as Vitest, A as ApiConfig, L as Logger, c as ResolvedCoverageOptions, C as CoverageMap, d as ReportContext, T as TestProject, e as TestSpecification, P as PoolWorker, f as PoolOptions, W as WorkerRequest, g as TestSequencer } from './chunks/plugin.d.cIKZEZ16.js';
|
|
7
|
+
export { M as AgentReporter, B as BaseCoverageOptions, h as BaseReporter, i as BenchmarkBuiltinReporters, j as BenchmarkReporter, k as BenchmarkReportsMap, l as BenchmarkUserOptions, m as BrowserBuiltinProvider, n as BrowserCommand, o as BrowserCommandContext, p as BrowserConfigOptions, q as BrowserInstanceOption, r as BrowserModuleMocker, s as BrowserOrchestrator, t as BrowserProvider, u as BrowserProviderOption, v as BrowserScript, w as BrowserServerFactory, x as BrowserServerOptions, y as BrowserServerState, z as BrowserServerStateSession, D as BuiltinEnvironment, E as BuiltinReporterOptions, F as BuiltinReporters, G as CSSModuleScopeStrategy, H as CacheKeyIdGenerator, I as CacheKeyIdGeneratorContext, J as CoverageInstrumenter, K as CoverageIstanbulOptions, N as CoverageOptions, O as CoverageProvider, Q as CoverageProviderModule, S as CoverageReporter, X as CoverageV8Options, Y as CustomProviderOptions, Z as DefaultReporter, _ as DepsOptimizationOptions, $ as DotReporter, a0 as EnvironmentOptions, a1 as GithubActionsReporter, a2 as HTMLOptions, a3 as HangingProcessReporter, a4 as InlineConfig, a5 as InstrumenterOptions, a6 as JUnitOptions, a7 as JUnitReporter, a8 as JsonAssertionResult, a9 as JsonOptions, aa as JsonReporter, ab as JsonTestResult, ac as JsonTestResults, M as MinimalReporter, ad as ModuleDiagnostic, ae as OnServerRestartHandler, af as OnTestsRerunHandler, ag as ParentProjectBrowser, ah as Pool, ai as PoolRunnerInitializer, aj as PoolTask, ak as ProjectBrowser, al as ProjectConfig, am as Report, an as ReportedHookContext, ao as Reporter, ap as ReportersMap, aq as ResolveSnapshotPathHandler, ar as ResolveSnapshotPathHandlerContext, as as ResolvedBrowserOptions, at as ResolvedProjectConfig, au as SerializedTestProject, av as TapFlatReporter, aw as TapReporter, ax as TaskOptions, ay as TestCase, az as TestCollection, aA as TestDiagnostic, aB as TestModule, aC as TestModuleState, aD as TestResult, aE as TestResultFailed, aF as TestResultPassed, aG as TestResultSkipped, aH as TestRunEndReason, aI as TestRunResult, aJ as TestSequencerConstructor, aK as TestSpecificationOptions, aL as TestState, aM as TestSuite, aN as TestSuiteState, aO as ToMatchScreenshotComparators, aP as ToMatchScreenshotOptions, aQ as TypecheckConfig, aR as UserWorkspaceConfig, aS as VerboseBenchmarkReporter, aT as VerboseReporter, aU as VitestEnvironment, aV as VitestPackageInstaller, aW as VitestPluginContext, aX as WatcherTriggerPattern, aY as WorkerResponse, aZ as _BrowserNames, a_ as experimental_getRunnerTask } from './chunks/plugin.d.cIKZEZ16.js';
|
|
8
|
+
import './chunks/browser.d.BUhkKcDl.js';
|
|
9
|
+
import { A as AfterSuiteRunMeta } from './chunks/general.d.DFAHgpC2.js';
|
|
10
10
|
import { Awaitable } from '@vitest/utils';
|
|
11
11
|
export { SerializedError } from '@vitest/utils';
|
|
12
|
-
import {
|
|
12
|
+
import { a as RuntimeRPC } from './chunks/rpc.d.7JZuxZ8u.js';
|
|
13
13
|
import { Writable } from 'node:stream';
|
|
14
|
-
import { C as ContextRPC } from './chunks/worker.d.
|
|
15
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
14
|
+
import { C as ContextRPC } from './chunks/worker.d.Bu1kXGw4.js';
|
|
15
|
+
export { T as TestExecutionType } from './chunks/worker.d.Bu1kXGw4.js';
|
|
16
16
|
import { Debugger } from 'obug';
|
|
17
|
-
import './chunks/global.d.
|
|
17
|
+
import './chunks/global.d.DhbKSQoV.js';
|
|
18
18
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
19
|
-
export {
|
|
19
|
+
export { b as RuntimeConfig } from './chunks/config.d.D91DHYaD.js';
|
|
20
20
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
21
21
|
export { CDPSession } from 'vitest/browser';
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
22
|
+
import 'node:fs/promises';
|
|
23
|
+
import '@vitest/runner/types';
|
|
24
24
|
import '@vitest/pretty-format';
|
|
25
|
-
import '@vitest/snapshot';
|
|
26
25
|
import '@vitest/utils/diff';
|
|
27
|
-
import '
|
|
26
|
+
import 'chai';
|
|
28
27
|
import 'vitest/optional-types.js';
|
|
29
|
-
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
30
|
-
import 'tinybench';
|
|
31
28
|
import '@vitest/mocker';
|
|
32
29
|
import '@vitest/utils/source-map';
|
|
33
|
-
import './chunks/coverage.d.
|
|
34
|
-
import '@vitest/snapshot/manager';
|
|
30
|
+
import './chunks/coverage.d.g2xbl2sP.js';
|
|
35
31
|
import 'node:console';
|
|
36
32
|
import 'node:fs';
|
|
33
|
+
import '@vitest/spy';
|
|
34
|
+
import 'tinyrainbow';
|
|
35
|
+
import '@vitest/utils/display';
|
|
36
|
+
import 'tinybench';
|
|
37
|
+
import './chunks/environment.d-DOJxxZV9.d.DOJxxZV9.js';
|
|
37
38
|
import 'vite/module-runner';
|
|
38
39
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
39
40
|
|
|
@@ -122,6 +123,100 @@ declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
|
|
|
122
123
|
*/
|
|
123
124
|
declare function resolveApiServerConfig<Options extends ApiConfig & Omit<UserConfig, "expect">>(options: Options, defaultPort: number, parentApi?: ApiConfig, logger?: Logger): ApiConfig | undefined;
|
|
124
125
|
|
|
126
|
+
type Threshold = "lines" | "functions" | "statements" | "branches";
|
|
127
|
+
interface ResolvedThreshold {
|
|
128
|
+
coverageMap: CoverageMap;
|
|
129
|
+
name: string;
|
|
130
|
+
thresholds: Partial<Record<Threshold, number | undefined>>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Holds info about raw coverage results that are stored on file system:
|
|
134
|
+
*
|
|
135
|
+
* ```json
|
|
136
|
+
* "project-a": {
|
|
137
|
+
* "web": {
|
|
138
|
+
* "tests/math.test.ts": "coverage-1.json",
|
|
139
|
+
* "tests/utils.test.ts": "coverage-2.json",
|
|
140
|
+
* // ^^^^^^^^^^^^^^^ Raw coverage on file system
|
|
141
|
+
* },
|
|
142
|
+
* "ssr": { ... },
|
|
143
|
+
* "browser": { ... },
|
|
144
|
+
* },
|
|
145
|
+
* "project-b": ...
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
type CoverageFiles = Map<NonNullable<AfterSuiteRunMeta["projectName"]> | symbol, Record<AfterSuiteRunMeta["environment"], {
|
|
149
|
+
[TestFilenames: string]: string;
|
|
150
|
+
}>>;
|
|
151
|
+
declare class BaseCoverageProvider {
|
|
152
|
+
ctx: Vitest;
|
|
153
|
+
readonly name: "v8" | "istanbul";
|
|
154
|
+
version: string;
|
|
155
|
+
options: ResolvedCoverageOptions;
|
|
156
|
+
globCache: Map<string, boolean>;
|
|
157
|
+
autoUpdateMarker: string;
|
|
158
|
+
coverageFiles: CoverageFiles;
|
|
159
|
+
pendingPromises: Promise<void>[];
|
|
160
|
+
coverageFilesDirectory: string;
|
|
161
|
+
roots: string[];
|
|
162
|
+
changedFiles?: string[];
|
|
163
|
+
_initialize(ctx: Vitest): void;
|
|
164
|
+
/**
|
|
165
|
+
* Check if file matches `coverage.include` but not `coverage.exclude`
|
|
166
|
+
*/
|
|
167
|
+
isIncluded(_filename: string, root?: string): boolean;
|
|
168
|
+
private getUntestedFilesByRoot;
|
|
169
|
+
getUntestedFiles(testedFiles: string[]): Promise<string[]>;
|
|
170
|
+
createCoverageMap(): CoverageMap;
|
|
171
|
+
generateReports(_: CoverageMap, __: boolean | undefined): Promise<void>;
|
|
172
|
+
parseConfigModule(_: string): Promise<{
|
|
173
|
+
generate: () => {
|
|
174
|
+
code: string;
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
resolveOptions(): ResolvedCoverageOptions;
|
|
178
|
+
clean(clean?: boolean): Promise<void>;
|
|
179
|
+
private normalizeCoverageFileError;
|
|
180
|
+
onAfterSuiteRun({ coverage, environment, projectName, testFiles }: AfterSuiteRunMeta): void;
|
|
181
|
+
readCoverageFiles<CoverageType>({ onFileRead, onFinished, onDebug }: {
|
|
182
|
+
/** Callback invoked with a single coverage result */
|
|
183
|
+
onFileRead: (data: CoverageType) => void;
|
|
184
|
+
/** Callback invoked once all results of a project for specific transform mode are read */
|
|
185
|
+
onFinished: (project: Vitest["projects"][number], environment: string) => Promise<void>;
|
|
186
|
+
onDebug: ((...logs: any[]) => void) & {
|
|
187
|
+
enabled: boolean;
|
|
188
|
+
};
|
|
189
|
+
}): Promise<void>;
|
|
190
|
+
cleanAfterRun(): Promise<void>;
|
|
191
|
+
onTestRunStart(): Promise<void>;
|
|
192
|
+
onTestFailure(): Promise<void>;
|
|
193
|
+
reportCoverage(coverageMap: unknown, { allTestsRun }: ReportContext): Promise<void>;
|
|
194
|
+
reportThresholds(coverageMap: CoverageMap, allTestsRun: boolean | undefined): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Constructs collected coverage and users' threshold options into separate sets
|
|
197
|
+
* where each threshold set holds their own coverage maps. Threshold set is either
|
|
198
|
+
* for specific files defined by glob pattern or global for all other files.
|
|
199
|
+
*/
|
|
200
|
+
private resolveThresholds;
|
|
201
|
+
/**
|
|
202
|
+
* Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached.
|
|
203
|
+
*/
|
|
204
|
+
private checkThresholds;
|
|
205
|
+
/**
|
|
206
|
+
* Check if current coverage is above configured thresholds and bump the thresholds if needed
|
|
207
|
+
*/
|
|
208
|
+
updateThresholds({ thresholds: allThresholds, onUpdate, configurationFile }: {
|
|
209
|
+
thresholds: ResolvedThreshold[];
|
|
210
|
+
configurationFile: unknown;
|
|
211
|
+
onUpdate: () => void;
|
|
212
|
+
}): Promise<void>;
|
|
213
|
+
mergeReports(coverageMaps: unknown[]): Promise<void>;
|
|
214
|
+
hasTerminalReporter(reporters: ResolvedCoverageOptions["reporter"]): boolean;
|
|
215
|
+
toSlices<T>(array: T[], size: number): T[][];
|
|
216
|
+
transformFile(url: string, project: TestProject, viteEnvironment: string, isTransformedByVite?: boolean): Promise<TransformResult | null | undefined>;
|
|
217
|
+
createUncoveredFileTransformer(ctx: Vitest): (filename: string) => Promise<TransformResult | null | undefined>;
|
|
218
|
+
}
|
|
219
|
+
|
|
125
220
|
declare function createVitest(mode: VitestRunMode, options: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
126
221
|
|
|
127
222
|
declare class FilesNotFoundError extends Error {
|
|
@@ -261,5 +356,5 @@ declare const createViteServer: typeof vite.createServer;
|
|
|
261
356
|
|
|
262
357
|
declare const rolldownVersion: string | undefined;
|
|
263
358
|
|
|
264
|
-
export { ApiConfig, BaseSequencer, ForksPoolWorker, GitNotFoundError, PoolOptions, PoolWorker, ResolvedConfig, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, ThreadsPoolWorker, TypecheckPoolWorker, Vitest, VitestOptions, VitestPlugin, VitestRunMode, VmForksPoolWorker, VmThreadsPoolWorker, WorkerRequest, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, escapeTestName, getFilePoolName, isFileServingAllowed, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, startVitest, version };
|
|
359
|
+
export { ApiConfig, BaseCoverageProvider, BaseSequencer, ForksPoolWorker, GitNotFoundError, PoolOptions, PoolWorker, ReportContext, ResolvedConfig, ResolvedCoverageOptions, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, ThreadsPoolWorker, TypecheckPoolWorker, Vitest, VitestOptions, VitestPlugin, VitestRunMode, VmForksPoolWorker, VmThreadsPoolWorker, WorkerRequest, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, escapeTestName, getFilePoolName, isFileServingAllowed, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, startVitest, version };
|
|
265
360
|
export type { CliOptions, CliParseOptions, ProcessPool, CollectLineNumbers as TypeCheckCollectLineNumbers, CollectLines as TypeCheckCollectLines, Context as TypeCheckContext, TscErrorInfo as TypeCheckErrorInfo, RawErrsMap as TypeCheckRawErrorsMap, RootAndTarget as TypeCheckRootAndTarget, WorkerContext };
|