vitest 3.2.4 → 4.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/dist/browser.d.ts +3 -5
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.DfmxU-tU.js → base.Bj3pWTr1.js} +1 -1
- package/dist/chunks/browser.d.DP0ACFkh.d.ts +18 -0
- package/dist/chunks/{cac.Cb-PYCCB.js → cac.CVVvMokL.js} +8 -19
- package/dist/chunks/{cli-api.BkDphVBG.js → cli-api.BUkNuHvl.js} +23 -22
- package/dist/chunks/{config.d.D2ROskhv.d.ts → config.d.HJdfX-8k.d.ts} +1 -2
- package/dist/chunks/{coverage.DL5VHqXY.js → coverage.BjMqihzx.js} +58 -37
- package/dist/chunks/{defaults.B7q_naMc.js → defaults.CXFFjsi8.js} +2 -42
- package/dist/chunks/environment.d.CUq4cUgQ.d.ts +44 -0
- package/dist/chunks/{global.d.MAmajcmJ.d.ts → global.d.CVbXEflG.d.ts} +7 -29
- package/dist/chunks/{globals.DEHgCU4V.js → globals.Cxal6MLI.js} +1 -1
- package/dist/chunks/{index.CdQS2e2Q.js → index.BWf_gE5n.js} +0 -2
- package/dist/chunks/{index.BCWujgDG.js → index.CJvUWPky.js} +1 -1
- package/dist/chunks/{index.CwejwG0H.js → index.D-VkfKhf.js} +2 -2
- package/dist/chunks/{index.VByaPkjc.js → index.a-yuRg2G.js} +223 -236
- package/dist/chunks/plugin.d.NmsBIHuT.d.ts +9 -0
- package/dist/chunks/{reporters.d.BFLkQcL6.d.ts → reporters.d.BbsDWlO9.d.ts} +2191 -2211
- package/dist/chunks/{rpc.-pEldfrD.js → rpc.CsFtxqeq.js} +4 -4
- package/dist/chunks/{runBaseTests.9Ij9_de-.js → runBaseTests.BC7ZIH5L.js} +4 -4
- package/dist/chunks/{setup-common.Dd054P77.js → setup-common.D7ZqXFx-.js} +1 -1
- package/dist/chunks/{worker.d.1GmBbd7G.d.ts → worker.d.COAQvn4k.d.ts} +6 -19
- package/dist/chunks/{worker.d.CKwWzBSj.d.ts → worker.d.CVn8WGlF.d.ts} +1 -1
- package/dist/cli.js +9 -9
- package/dist/config.cjs +2 -49
- package/dist/config.d.ts +36 -30
- package/dist/config.js +2 -8
- package/dist/coverage.d.ts +15 -9
- package/dist/coverage.js +6 -5
- package/dist/environments.d.ts +2 -3
- package/dist/execute.d.ts +3 -5
- package/dist/index.d.ts +24 -181
- package/dist/index.js +1 -1
- package/dist/node.d.ts +37 -28
- package/dist/node.js +13 -19
- package/dist/reporters.d.ts +9 -9
- package/dist/reporters.js +12 -12
- package/dist/runners.d.ts +1 -2
- package/dist/runners.js +10 -2
- package/dist/worker.js +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +4 -4
- package/dist/workers/threads.js +1 -1
- package/dist/workers.d.ts +4 -7
- package/dist/workers.js +2 -2
- package/globals.d.ts +17 -17
- package/package.json +12 -12
- package/dist/chunks/environment.d.cL3nLXbE.d.ts +0 -119
- package/dist/chunks/vite.d.CMLlLIFP.d.ts +0 -25
- package/dist/chunks/{typechecker.DRKU1-1g.js → typechecker.CVytUJuF.js} +26 -26
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.D2ROskhv.js';
|
|
13
|
-
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.D2ROskhv.js';
|
|
1
|
+
import { S as SerializedTestSpecification } from './chunks/browser.d.DP0ACFkh.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.DP0ACFkh.js';
|
|
3
|
+
import './chunks/global.d.CVbXEflG.js';
|
|
4
|
+
import { File, TestAnnotation, TaskResultPack, TaskEventPack, TaskPopulated } from '@vitest/runner';
|
|
5
|
+
export { CancelReason, HookCleanupCallback, HookListener, 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, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
6
|
+
import { a as BirpcReturn } from './chunks/worker.d.COAQvn4k.js';
|
|
7
|
+
export { C as ContextRPC, c as ContextTestEnvironment, b as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.COAQvn4k.js';
|
|
8
|
+
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.HJdfX-8k.js';
|
|
9
|
+
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.HJdfX-8k.js';
|
|
10
|
+
import { b as Awaitable, U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/environment.d.CUq4cUgQ.js';
|
|
11
|
+
export { A as AfterSuiteRunMeta } from './chunks/environment.d.CUq4cUgQ.js';
|
|
14
12
|
import { ExpectStatic } from '@vitest/expect';
|
|
15
13
|
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers } from '@vitest/expect';
|
|
16
14
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
@@ -20,26 +18,14 @@ export { b as bench } from './chunks/suite.d.FvehnV49.js';
|
|
|
20
18
|
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.BwvBVTda.js';
|
|
21
19
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
22
20
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
23
|
-
export {
|
|
21
|
+
export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
24
22
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
25
23
|
import * as chai from 'chai';
|
|
26
24
|
export { chai };
|
|
27
25
|
export { assert, should } from 'chai';
|
|
28
26
|
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
|
|
29
|
-
import 'node:stream';
|
|
30
|
-
import 'vite';
|
|
31
|
-
import 'node:console';
|
|
32
|
-
import '@vitest/mocker';
|
|
33
|
-
import '@vitest/utils/source-map';
|
|
34
27
|
import '@vitest/pretty-format';
|
|
35
|
-
import '
|
|
36
|
-
import './chunks/coverage.d.S9RMNXIe.js';
|
|
37
|
-
import 'vite-node/client';
|
|
38
|
-
import '@vitest/snapshot/manager';
|
|
39
|
-
import 'node:fs';
|
|
40
|
-
import 'node:worker_threads';
|
|
41
|
-
import 'vitest/optional-types.js';
|
|
42
|
-
import '@vitest/snapshot/environment';
|
|
28
|
+
import '@vitest/mocker';
|
|
43
29
|
import '@vitest/runner/utils';
|
|
44
30
|
|
|
45
31
|
interface SourceMap {
|
|
@@ -63,14 +49,11 @@ interface TransformResultWithSource {
|
|
|
63
49
|
source?: string;
|
|
64
50
|
}
|
|
65
51
|
interface WebSocketHandlers {
|
|
66
|
-
onTaskUpdate: (packs: TaskResultPack
|
|
67
|
-
getFiles: () => File
|
|
52
|
+
onTaskUpdate: (packs: TaskResultPack[], events: TaskEventPack[]) => void;
|
|
53
|
+
getFiles: () => File[];
|
|
68
54
|
getTestFiles: () => Promise<SerializedTestSpecification[]>;
|
|
69
55
|
getPaths: () => string[];
|
|
70
56
|
getConfig: () => SerializedConfig;
|
|
71
|
-
// TODO: Remove in v4
|
|
72
|
-
/** @deprecated -- Use `getResolvedProjectLabels` instead */
|
|
73
|
-
getResolvedProjectNames: () => string[];
|
|
74
57
|
getResolvedProjectLabels: () => {
|
|
75
58
|
name: string
|
|
76
59
|
color?: LabelColor
|
|
@@ -81,23 +64,21 @@ interface WebSocketHandlers {
|
|
|
81
64
|
saveTestFile: (id: string, content: string) => Promise<void>;
|
|
82
65
|
rerun: (files: string[], resetTestNamePattern?: boolean) => Promise<void>;
|
|
83
66
|
rerunTask: (id: string) => Promise<void>;
|
|
84
|
-
updateSnapshot: (file?: File
|
|
67
|
+
updateSnapshot: (file?: File) => Promise<void>;
|
|
85
68
|
getUnhandledErrors: () => unknown[];
|
|
86
69
|
}
|
|
87
70
|
interface WebSocketEvents {
|
|
88
|
-
onCollected?: (files?: File
|
|
89
|
-
onFinished?: (files: File
|
|
90
|
-
onTestAnnotate?: (testId: string, annotation: TestAnnotation) => Awaitable
|
|
91
|
-
onTaskUpdate?: (packs: TaskResultPack
|
|
92
|
-
onUserConsoleLog?: (log: UserConsoleLog) => Awaitable
|
|
93
|
-
onPathsCollected?: (paths?: string[]) => Awaitable
|
|
94
|
-
onSpecsCollected?: (specs?: SerializedTestSpecification[]) => Awaitable
|
|
71
|
+
onCollected?: (files?: File[]) => Awaitable<void>;
|
|
72
|
+
onFinished?: (files: File[], errors: unknown[], coverage?: unknown) => Awaitable<void>;
|
|
73
|
+
onTestAnnotate?: (testId: string, annotation: TestAnnotation) => Awaitable<void>;
|
|
74
|
+
onTaskUpdate?: (packs: TaskResultPack[], events: TaskEventPack[]) => Awaitable<void>;
|
|
75
|
+
onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
|
|
76
|
+
onPathsCollected?: (paths?: string[]) => Awaitable<void>;
|
|
77
|
+
onSpecsCollected?: (specs?: SerializedTestSpecification[]) => Awaitable<void>;
|
|
95
78
|
onFinishedReportCoverage: () => void;
|
|
96
79
|
}
|
|
97
80
|
type WebSocketRPC = BirpcReturn<WebSocketEvents, WebSocketHandlers>;
|
|
98
81
|
|
|
99
|
-
// CI fails only for this file, but it works locally
|
|
100
|
-
|
|
101
82
|
declare function createExpect(test?: TaskPopulated): ExpectStatic;
|
|
102
83
|
declare const globalExpect: ExpectStatic;
|
|
103
84
|
|
|
@@ -509,143 +490,5 @@ interface BrowserUI {
|
|
|
509
490
|
setIframeViewport: (width: number, height: number) => Promise<void>;
|
|
510
491
|
}
|
|
511
492
|
|
|
512
|
-
/** @deprecated import `TypeCheckRawErrorsMap` from `vitest/node` instead */
|
|
513
|
-
type RawErrsMap = RawErrsMap$1;
|
|
514
|
-
/** @deprecated import `TypeCheckErrorInfo` from `vitest/node` instead */
|
|
515
|
-
type TscErrorInfo = TscErrorInfo$1;
|
|
516
|
-
/** @deprecated import `TypeCheckCollectLineNumbers` from `vitest/node` instead */
|
|
517
|
-
type CollectLineNumbers = CollectLineNumbers$1;
|
|
518
|
-
/** @deprecated import `TypeCheckCollectLines` from `vitest/node` instead */
|
|
519
|
-
type CollectLines = CollectLines$1;
|
|
520
|
-
/** @deprecated import `TypeCheckRootAndTarget` from `vitest/node` instead */
|
|
521
|
-
type RootAndTarget = RootAndTarget$1;
|
|
522
|
-
/** @deprecated import `TypeCheckContext` from `vitest/node` instead */
|
|
523
|
-
type Context = Context$1;
|
|
524
|
-
/** @deprecated use `RunnerTestSuite` instead */
|
|
525
|
-
type Suite = Suite$1;
|
|
526
|
-
/** @deprecated use `RunnerTestFile` instead */
|
|
527
|
-
type File = File$1;
|
|
528
|
-
/** @deprecated use `RunnerTestCase` instead */
|
|
529
|
-
type Test = Test$1;
|
|
530
|
-
/** @deprecated do not use `Custom`, use `RunnerTestCase` instead */
|
|
531
|
-
type Custom = Custom$1;
|
|
532
|
-
/** @deprecated use `RunnerTask` instead */
|
|
533
|
-
type Task = Task$1;
|
|
534
|
-
/** @deprecated use `RunnerTaskBase` instead */
|
|
535
|
-
type TaskBase = TaskBase$1;
|
|
536
|
-
/** @deprecated use `RunnerTaskResult` instead */
|
|
537
|
-
type TaskResult = TaskResult$1;
|
|
538
|
-
/** @deprecated use `RunnerTaskResultPack` instead */
|
|
539
|
-
type TaskResultPack = TaskResultPack$1;
|
|
540
|
-
/** @deprecated don't use `DoneCallback` since it's not supported */
|
|
541
|
-
type DoneCallback = DoneCallback$1;
|
|
542
|
-
/** @deprecated internal type, don't use it */
|
|
543
|
-
type RuntimeContext = RuntimeContext$1;
|
|
544
|
-
/** @deprecated internal type, don't use it */
|
|
545
|
-
type SuiteHooks = SuiteHooks$1;
|
|
546
|
-
|
|
547
|
-
/** @deprecated import from `vitest/node` instead */
|
|
548
|
-
type WorkerContext = WorkerContext$1;
|
|
549
|
-
/** @deprecated import from `vitest/node` instead */
|
|
550
|
-
type WorkerRPC = WorkerRPC$1;
|
|
551
|
-
|
|
552
|
-
/** @deprecated do not use, internal helper */
|
|
553
|
-
type Awaitable<T> = Awaitable$1<T>;
|
|
554
|
-
/** @deprecated do not use, internal helper */
|
|
555
|
-
type Nullable<T> = Nullable$1<T>;
|
|
556
|
-
/** @deprecated do not use, internal helper */
|
|
557
|
-
type Arrayable<T> = Arrayable$1<T>;
|
|
558
|
-
/** @deprecated do not use, internal helper */
|
|
559
|
-
type ArgumentsType<T> = ArgumentsType$1<T>;
|
|
560
|
-
/** @deprecated do not use, internal helper */
|
|
561
|
-
type MutableArray<T extends readonly any[]> = MutableArray$1<T>;
|
|
562
|
-
/** @deprecated do not use, internal helper */
|
|
563
|
-
type Constructable = Constructable$1;
|
|
564
|
-
|
|
565
|
-
/** @deprecated import from `vitest/environments` instead */
|
|
566
|
-
type EnvironmentReturn = EnvironmentReturn$1;
|
|
567
|
-
/** @deprecated import from `vitest/environments` instead */
|
|
568
|
-
type VmEnvironmentReturn = VmEnvironmentReturn$1;
|
|
569
|
-
/** @deprecated import from `vitest/environments` instead */
|
|
570
|
-
type Environment = Environment$1;
|
|
571
|
-
/** @deprecated do not use it */
|
|
572
|
-
type ResolvedTestEnvironment = ResolvedTestEnvironment$1;
|
|
573
|
-
/** @deprecated import from `vitest/node` instead */
|
|
574
|
-
type CoverageProvider = CoverageProvider$1;
|
|
575
|
-
/** @deprecated import from `vitest/node` instead */
|
|
576
|
-
type ReportContext = ReportContext$1;
|
|
577
|
-
/** @deprecated import from `vitest/node` instead */
|
|
578
|
-
type CoverageProviderModule = CoverageProviderModule$1;
|
|
579
|
-
/** @deprecated import from `vitest/node` instead */
|
|
580
|
-
type CoverageReporter = CoverageReporter$1;
|
|
581
|
-
/** @deprecated import from `vitest/node` instead */
|
|
582
|
-
type CoverageOptions<T extends CoverageProviderName = CoverageProviderName> = CoverageOptions$1<T>;
|
|
583
|
-
/** @deprecated import from `vitest/node` instead */
|
|
584
|
-
type ResolvedCoverageOptions<T extends CoverageProviderName = CoverageProviderName> = ResolvedCoverageOptions$1<T>;
|
|
585
|
-
/** @deprecated import from `vitest/node` instead */
|
|
586
|
-
type BaseCoverageOptions = BaseCoverageOptions$1;
|
|
587
|
-
/** @deprecated import from `vitest/node` instead */
|
|
588
|
-
type CoverageIstanbulOptions = CoverageIstanbulOptions$1;
|
|
589
|
-
/** @deprecated import from `vitest/node` instead */
|
|
590
|
-
type CoverageV8Options = CoverageV8Options$1;
|
|
591
|
-
/** @deprecated import from `vitest/node` instead */
|
|
592
|
-
type CustomProviderOptions = CustomProviderOptions$1;
|
|
593
|
-
|
|
594
|
-
/** @deprecated import from `vitest/reporter` instead */
|
|
595
|
-
type Reporter = Reporter$1;
|
|
596
|
-
/** @deprecated import from `vitest/node` instead */
|
|
597
|
-
type Vitest = Vitest$1;
|
|
598
|
-
|
|
599
|
-
/** @deprecated import from `vitest/node` instead */
|
|
600
|
-
type BrowserScript = BrowserScript$1;
|
|
601
|
-
/** @deprecated import from `vitest/node` instead */
|
|
602
|
-
type BrowserConfigOptions = BrowserConfigOptions$1;
|
|
603
|
-
/** @deprecated import from `vitest/node` instead */
|
|
604
|
-
type SequenceHooks = SequenceHooks$1;
|
|
605
|
-
/** @deprecated import from `vitest/node` instead */
|
|
606
|
-
type SequenceSetupFiles = SequenceSetupFiles$1;
|
|
607
|
-
/** @deprecated import from `vitest/node` instead */
|
|
608
|
-
type BuiltinEnvironment = BuiltinEnvironment$1;
|
|
609
|
-
/** @deprecated import from `vitest/node` instead */
|
|
610
|
-
type VitestEnvironment = VitestEnvironment$1;
|
|
611
|
-
/** @deprecated import from `vitest/node` instead */
|
|
612
|
-
type Pool = Pool$1;
|
|
613
|
-
/** @deprecated import from `vitest/node` instead */
|
|
614
|
-
type PoolOptions = PoolOptions$1;
|
|
615
|
-
/** @deprecated import from `vitest/node` instead */
|
|
616
|
-
type CSSModuleScopeStrategy = CSSModuleScopeStrategy$1;
|
|
617
|
-
/** @deprecated import from `vitest/node` instead */
|
|
618
|
-
type ApiConfig = ApiConfig$1;
|
|
619
|
-
/** @deprecated import from `vitest/node` instead */
|
|
620
|
-
type JSDOMOptions = JSDOMOptions$1;
|
|
621
|
-
/** @deprecated import from `vitest/node` instead */
|
|
622
|
-
type HappyDOMOptions = HappyDOMOptions$1;
|
|
623
|
-
/** @deprecated import from `vitest/node` instead */
|
|
624
|
-
type EnvironmentOptions = EnvironmentOptions$1;
|
|
625
|
-
/** @deprecated import from `vitest/node` instead */
|
|
626
|
-
type VitestRunMode = VitestRunMode$1;
|
|
627
|
-
/** @deprecated import from `vitest/node` instead */
|
|
628
|
-
type DepsOptimizationOptions = DepsOptimizationOptions$1;
|
|
629
|
-
/** @deprecated import from `vitest/node` instead */
|
|
630
|
-
type TransformModePatterns = TransformModePatterns$1;
|
|
631
|
-
/** @deprecated import from `vitest/node` instead */
|
|
632
|
-
type InlineConfig = InlineConfig$1;
|
|
633
|
-
/** @deprecated import from `vitest/node` instead */
|
|
634
|
-
type TypecheckConfig = TypecheckConfig$1;
|
|
635
|
-
/** @deprecated import from `vitest/node` instead */
|
|
636
|
-
type UserConfig = UserConfig$1;
|
|
637
|
-
/** @deprecated import from `vitest/node` instead */
|
|
638
|
-
type ResolvedConfig = ResolvedConfig$1;
|
|
639
|
-
/** @deprecated import from `vitest/node` instead */
|
|
640
|
-
type ProjectConfig = ProjectConfig$1;
|
|
641
|
-
/** @deprecated import from `vitest/node` instead */
|
|
642
|
-
type UserWorkspaceConfig = UserWorkspaceConfig$1;
|
|
643
|
-
|
|
644
|
-
/** @deprecated use `SerializedTestSpecification` instead */
|
|
645
|
-
type SerializableSpec = SerializedTestSpecification;
|
|
646
|
-
|
|
647
|
-
/** @deprecated import from `vitest/node` instead */
|
|
648
|
-
type BenchmarkUserOptions = BenchmarkUserOptions$1;
|
|
649
|
-
|
|
650
493
|
export { LabelColor, ModuleGraphData, ProvidedContext, SerializedConfig, SerializedTestSpecification, UserConsoleLog, assertType, createExpect, globalExpect as expect, inject, vi, vitest };
|
|
651
|
-
export type {
|
|
494
|
+
export type { AssertType, BrowserUI, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.bdSIJ99Y.js';
|
|
2
2
|
export { b as bench } from './chunks/benchmark.CYdenmiT.js';
|
|
3
|
-
export { a as assertType } from './chunks/index.
|
|
3
|
+
export { a as assertType } from './chunks/index.BWf_gE5n.js';
|
|
4
4
|
export { expectTypeOf } from 'expect-type';
|
|
5
5
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
6
6
|
import * as chai from 'chai';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
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.BFLkQcL6.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.BFLkQcL6.js';
|
|
3
1
|
import * as vite from 'vite';
|
|
4
2
|
import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1 } from 'vite';
|
|
5
3
|
export { vite as Vite };
|
|
6
4
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
7
5
|
import { IncomingMessage } from 'node:http';
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
6
|
+
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, k as TestSequencer, l as TestSpecification, L as Logger } from './chunks/reporters.d.BbsDWlO9.js';
|
|
7
|
+
export { ao as BaseCoverageOptions, K as BenchmarkUserOptions, N as BrowserBuiltinProvider, Q as BrowserCommand, X as BrowserCommandContext, Y as BrowserConfigOptions, Z as BrowserInstanceOption, _ as BrowserModuleMocker, $ as BrowserOrchestrator, a0 as BrowserProvider, a1 as BrowserProviderInitializationOptions, a2 as BrowserProviderModule, a3 as BrowserProviderOptions, a4 as BrowserScript, a5 as BrowserServerState, a6 as BrowserServerStateSession, ab as BuiltinEnvironment, a7 as CDPSession, ac as CSSModuleScopeStrategy, ap as CoverageIstanbulOptions, aq as CoverageOptions, ar as CoverageProvider, as as CoverageProviderModule, at as CoverageReporter, c as CoverageV8Options, au as CustomProviderOptions, ad as DepsOptimizationOptions, ae as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, q as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, m as OnTestsRerunHandler, a8 as ParentProjectBrowser, af as Pool, ag as PoolOptions, P as ProcessPool, a9 as ProjectBrowser, ah as ProjectConfig, b as ReportContext, aw as ReportedHookContext, ax as Reporter, aj as ResolveSnapshotPathHandler, ak as ResolveSnapshotPathHandlerContext, aa as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ai as ResolvedProjectConfig, S as SerializedTestProject, r as TaskOptions, s as TestCase, t as TestCollection, u as TestDiagnostic, v as TestModule, w as TestModuleState, x as TestResult, y as TestResultFailed, z as TestResultPassed, B as TestResultSkipped, ay as TestRunEndReason, av as TestRunResult, G as TestSequencerConstructor, D as TestState, E as TestSuite, F as TestSuiteState, al as TransformModePatterns, am as TypecheckConfig, U as UserWorkspaceConfig, an as VitestEnvironment, n as VitestPackageInstaller, W as WatcherTriggerPattern, o as WorkspaceSpec, p as getFilePoolName } from './chunks/reporters.d.BbsDWlO9.js';
|
|
8
|
+
import { R as RuntimeRPC } from './chunks/worker.d.COAQvn4k.js';
|
|
9
|
+
export { T as TestExecutionType } from './chunks/worker.d.COAQvn4k.js';
|
|
10
10
|
import { Writable } from 'node:stream';
|
|
11
|
-
export { V as VitestPluginContext } from './chunks/
|
|
12
|
-
export { W as WorkerContext } from './chunks/worker.d.
|
|
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';
|
|
11
|
+
export { V as VitestPluginContext } from './chunks/plugin.d.NmsBIHuT.js';
|
|
12
|
+
export { W as WorkerContext } from './chunks/worker.d.CVn8WGlF.js';
|
|
14
13
|
import { Debugger } from 'debug';
|
|
14
|
+
import './chunks/global.d.CVbXEflG.js';
|
|
15
15
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
16
|
-
export {
|
|
16
|
+
export { b as RuntimeConfig } from './chunks/config.d.HJdfX-8k.js';
|
|
17
17
|
export { SerializedError } from '@vitest/utils';
|
|
18
|
-
export { b as RuntimeConfig } from './chunks/config.d.D2ROskhv.js';
|
|
19
18
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
19
|
+
import './chunks/environment.d.CUq4cUgQ.js';
|
|
20
20
|
import 'node:console';
|
|
21
|
+
import './chunks/browser.d.DP0ACFkh.js';
|
|
21
22
|
import '@vitest/mocker';
|
|
22
23
|
import '@vitest/utils/source-map';
|
|
23
24
|
import '@vitest/pretty-format';
|
|
@@ -25,6 +26,7 @@ import '@vitest/snapshot';
|
|
|
25
26
|
import '@vitest/utils/diff';
|
|
26
27
|
import 'vite-node';
|
|
27
28
|
import 'chai';
|
|
29
|
+
import 'vitest/optional-types.js';
|
|
28
30
|
import './chunks/benchmark.d.BwvBVTda.js';
|
|
29
31
|
import 'tinybench';
|
|
30
32
|
import './chunks/coverage.d.S9RMNXIe.js';
|
|
@@ -33,8 +35,30 @@ import '@vitest/snapshot/manager';
|
|
|
33
35
|
import 'node:fs';
|
|
34
36
|
import 'node:worker_threads';
|
|
35
37
|
import '@vitest/expect';
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
type RawErrsMap = Map<string, TscErrorInfo[]>;
|
|
40
|
+
interface TscErrorInfo {
|
|
41
|
+
filePath: string;
|
|
42
|
+
errCode: number;
|
|
43
|
+
errMsg: string;
|
|
44
|
+
line: number;
|
|
45
|
+
column: number;
|
|
46
|
+
}
|
|
47
|
+
interface CollectLineNumbers {
|
|
48
|
+
target: number;
|
|
49
|
+
next: number;
|
|
50
|
+
prev?: number;
|
|
51
|
+
}
|
|
52
|
+
type CollectLines = { [key in keyof CollectLineNumbers] : string };
|
|
53
|
+
interface RootAndTarget {
|
|
54
|
+
root: string;
|
|
55
|
+
targetAbsPath: string;
|
|
56
|
+
}
|
|
57
|
+
type Context = RootAndTarget & {
|
|
58
|
+
rawErrsMap: RawErrsMap
|
|
59
|
+
openedDirs: Set<string>
|
|
60
|
+
lastActivePath?: string
|
|
61
|
+
};
|
|
38
62
|
|
|
39
63
|
declare function isValidApiRequest(config: ResolvedConfig, req: IncomingMessage): boolean;
|
|
40
64
|
|
|
@@ -93,9 +117,6 @@ declare class GitNotFoundError extends Error {
|
|
|
93
117
|
constructor();
|
|
94
118
|
}
|
|
95
119
|
|
|
96
|
-
/** @deprecated use `TestProject` instead */
|
|
97
|
-
type GlobalSetupContext = TestProject;
|
|
98
|
-
|
|
99
120
|
declare function VitestPlugin(options?: UserConfig, vitest?: Vitest): Promise<Plugin[]>;
|
|
100
121
|
|
|
101
122
|
// this is only exported as a public function and not used inside vitest
|
|
@@ -137,22 +158,10 @@ declare function createDebugger(namespace: `vitest:${string}`): Debugger | undef
|
|
|
137
158
|
|
|
138
159
|
declare const version: string;
|
|
139
160
|
|
|
140
|
-
/** @deprecated use `createViteServer` instead */
|
|
141
|
-
declare const createServer: typeof vite.createServer;
|
|
142
161
|
declare const createViteServer: typeof vite.createServer;
|
|
143
162
|
|
|
144
|
-
/**
|
|
145
|
-
* @deprecated Use `TestModule` instead
|
|
146
|
-
*/
|
|
147
|
-
declare const TestFile: typeof TestModule;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* @deprecated Use `ModuleDiagnostic` instead
|
|
151
|
-
*/
|
|
152
|
-
type FileDiagnostic = ModuleDiagnostic;
|
|
153
|
-
|
|
154
163
|
// rolldownVersion is exported only by rolldown-vite
|
|
155
164
|
declare const rolldownVersion: string | undefined;
|
|
156
165
|
|
|
157
|
-
export { ApiConfig, BaseSequencer, GitNotFoundError,
|
|
158
|
-
export type { CliParseOptions,
|
|
166
|
+
export { ApiConfig, BaseSequencer, GitNotFoundError, ResolvedConfig, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, Vitest, VitestOptions, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, startVitest, version };
|
|
167
|
+
export type { CliParseOptions, CollectLineNumbers as TypeCheckCollectLineNumbers, CollectLines as TypeCheckCollectLines, Context as TypeCheckContext, TscErrorInfo as TypeCheckErrorInfo, RawErrsMap as TypeCheckRawErrorsMap, RootAndTarget as TypeCheckRootAndTarget };
|
package/dist/node.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
3
3
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
4
|
-
import { V as Vitest, a as VitestPlugin
|
|
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.
|
|
6
|
-
export { p as parseCLI } from './chunks/cac.
|
|
7
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
8
|
-
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.BUkNuHvl.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.BUkNuHvl.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.CVVvMokL.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.BjMqihzx.js';
|
|
8
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.BjMqihzx.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils';
|
|
10
10
|
import { f as findUp } from './chunks/index.X0nbfr6-.js';
|
|
11
11
|
import { resolve } from 'pathe';
|
|
@@ -20,17 +20,17 @@ import '@vitest/snapshot/manager';
|
|
|
20
20
|
import 'vite-node/client';
|
|
21
21
|
import 'vite-node/server';
|
|
22
22
|
import './chunks/index.B521nVV-.js';
|
|
23
|
-
import './chunks/index.
|
|
23
|
+
import './chunks/index.a-yuRg2G.js';
|
|
24
|
+
import 'node:fs/promises';
|
|
25
|
+
import './chunks/typechecker.CVytUJuF.js';
|
|
26
|
+
import 'node:os';
|
|
24
27
|
import 'node:perf_hooks';
|
|
25
28
|
import '@vitest/utils/source-map';
|
|
29
|
+
import 'tinyexec';
|
|
26
30
|
import 'tinyrainbow';
|
|
27
31
|
import './chunks/env.D4Lgay0q.js';
|
|
28
32
|
import 'std-env';
|
|
29
|
-
import './chunks/typechecker.DRKU1-1g.js';
|
|
30
|
-
import 'node:os';
|
|
31
|
-
import 'tinyexec';
|
|
32
33
|
import 'node:util';
|
|
33
|
-
import 'node:fs/promises';
|
|
34
34
|
import 'node:console';
|
|
35
35
|
import 'node:stream';
|
|
36
36
|
import 'node:module';
|
|
@@ -51,9 +51,9 @@ import 'picomatch';
|
|
|
51
51
|
import 'tinyglobby';
|
|
52
52
|
import 'vite-node/utils';
|
|
53
53
|
import '@vitest/mocker/node';
|
|
54
|
-
import './chunks/defaults.
|
|
54
|
+
import './chunks/defaults.CXFFjsi8.js';
|
|
55
55
|
import 'magic-string';
|
|
56
|
-
import './chunks/index.
|
|
56
|
+
import './chunks/index.CJvUWPky.js';
|
|
57
57
|
import 'node:assert';
|
|
58
58
|
import '@vitest/utils/error';
|
|
59
59
|
import 'node:readline';
|
|
@@ -92,14 +92,8 @@ function createDebugger(namespace) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
const version = Vitest.version;
|
|
95
|
-
/** @deprecated use `createViteServer` instead */
|
|
96
|
-
const createServer = vite.createServer;
|
|
97
95
|
const createViteServer = vite.createServer;
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated Use `TestModule` instead
|
|
100
|
-
*/
|
|
101
|
-
const TestFile = TestModule;
|
|
102
96
|
// rolldownVersion is exported only by rolldown-vite
|
|
103
97
|
const rolldownVersion = vite.rolldownVersion;
|
|
104
98
|
|
|
105
|
-
export {
|
|
99
|
+
export { VitestPlugin, createDebugger, createViteServer, resolveConfig, rolldownVersion, version };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aM as BaseReporter, aN as BenchmarkBuiltinReporters, az as BenchmarkReporter, aA as BenchmarkReportsMap, aO as BuiltinReporterOptions, aP as BuiltinReporters, aB as DefaultReporter, aC as DotReporter, aD as GithubActionsReporter, aE as HangingProcessReporter, aG as JUnitReporter, aQ as JsonAssertionResult, aF as JsonReporter, aR as JsonTestResult, aS as JsonTestResults, aw as ReportedHookContext, ax as Reporter, aH as ReportersMap, aI as TapFlatReporter, aJ as TapReporter, ay as TestRunEndReason, aK as VerboseBenchmarkReporter, aL as VerboseReporter } from './chunks/reporters.d.BbsDWlO9.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
|
-
import './chunks/environment.d.
|
|
4
|
-
import 'vitest/optional-types.js';
|
|
3
|
+
import './chunks/environment.d.CUq4cUgQ.js';
|
|
5
4
|
import '@vitest/utils';
|
|
6
5
|
import 'node:stream';
|
|
7
6
|
import 'vite';
|
|
8
7
|
import 'node:console';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import './chunks/
|
|
12
|
-
import 'vite-node';
|
|
13
|
-
import './chunks/config.d.D2ROskhv.js';
|
|
8
|
+
import './chunks/browser.d.DP0ACFkh.js';
|
|
9
|
+
import './chunks/worker.d.COAQvn4k.js';
|
|
10
|
+
import './chunks/config.d.HJdfX-8k.js';
|
|
14
11
|
import '@vitest/pretty-format';
|
|
15
12
|
import '@vitest/snapshot';
|
|
16
|
-
import '@vitest/snapshot/environment';
|
|
17
13
|
import '@vitest/utils/diff';
|
|
14
|
+
import '@vitest/mocker';
|
|
15
|
+
import '@vitest/utils/source-map';
|
|
16
|
+
import 'vite-node';
|
|
18
17
|
import 'chai';
|
|
18
|
+
import 'vitest/optional-types.js';
|
|
19
19
|
import './chunks/benchmark.d.BwvBVTda.js';
|
|
20
20
|
import '@vitest/runner/utils';
|
|
21
21
|
import 'tinybench';
|
package/dist/reporters.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
3
|
-
import 'node:
|
|
4
|
-
import '
|
|
5
|
-
import '@vitest/utils';
|
|
6
|
-
import '@vitest/utils/source-map';
|
|
1
|
+
export { 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.a-yuRg2G.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CJvUWPky.js';
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'node:fs/promises';
|
|
7
5
|
import 'pathe';
|
|
8
|
-
import '
|
|
9
|
-
import './chunks/env.D4Lgay0q.js';
|
|
10
|
-
import 'std-env';
|
|
11
|
-
import './chunks/typechecker.DRKU1-1g.js';
|
|
6
|
+
import './chunks/typechecker.CVytUJuF.js';
|
|
12
7
|
import 'node:os';
|
|
8
|
+
import 'node:perf_hooks';
|
|
9
|
+
import '@vitest/utils/source-map';
|
|
13
10
|
import 'tinyexec';
|
|
14
11
|
import './path.js';
|
|
15
12
|
import 'node:path';
|
|
16
13
|
import 'node:url';
|
|
14
|
+
import '@vitest/runner/utils';
|
|
15
|
+
import '@vitest/utils';
|
|
17
16
|
import 'vite';
|
|
17
|
+
import 'tinyrainbow';
|
|
18
|
+
import './chunks/env.D4Lgay0q.js';
|
|
19
|
+
import 'std-env';
|
|
18
20
|
import 'node:util';
|
|
19
|
-
import 'node:fs';
|
|
20
|
-
import 'node:fs/promises';
|
|
21
21
|
import 'node:console';
|
|
22
22
|
import 'node:stream';
|
|
23
23
|
import 'node:module';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
2
|
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
|
|
3
3
|
export { VitestRunner } from '@vitest/runner';
|
|
4
|
-
import { a as SerializedConfig } from './chunks/config.d.
|
|
4
|
+
import { a as SerializedConfig } from './chunks/config.d.HJdfX-8k.js';
|
|
5
5
|
import '@vitest/pretty-format';
|
|
6
6
|
import '@vitest/snapshot';
|
|
7
|
-
import '@vitest/snapshot/environment';
|
|
8
7
|
import '@vitest/utils/diff';
|
|
9
8
|
|
|
10
9
|
declare class NodeBenchmarkRunner implements VitestRunner {
|
package/dist/runners.js
CHANGED
|
@@ -4,13 +4,13 @@ import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.CYdenm
|
|
|
4
4
|
import { g as getWorkerState } from './chunks/utils.XdZDrNZV.js';
|
|
5
5
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
6
6
|
import { getTests, getNames, getTestName } from '@vitest/runner/utils';
|
|
7
|
+
import { processError } from '@vitest/utils/error';
|
|
7
8
|
import { normalize } from 'pathe';
|
|
8
9
|
import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.bdSIJ99Y.js';
|
|
9
|
-
import { r as rpc } from './chunks/rpc
|
|
10
|
+
import { r as rpc } from './chunks/rpc.CsFtxqeq.js';
|
|
10
11
|
import 'chai';
|
|
11
12
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
12
13
|
import '@vitest/snapshot';
|
|
13
|
-
import '@vitest/utils/error';
|
|
14
14
|
import '@vitest/spy';
|
|
15
15
|
import '@vitest/utils/source-map';
|
|
16
16
|
import './chunks/date.Bq6ZW5rf.js';
|
|
@@ -117,6 +117,7 @@ class NodeBenchmarkRunner {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
// import type { VitestExecutor } from '../execute'
|
|
120
121
|
// worker context is shared between all tests
|
|
121
122
|
const workerContext = Object.create(null);
|
|
122
123
|
class VitestTestRunner {
|
|
@@ -155,6 +156,13 @@ class VitestTestRunner {
|
|
|
155
156
|
this.snapshotClient.skipTest(suite.file.filepath, name);
|
|
156
157
|
}
|
|
157
158
|
const result = await this.snapshotClient.finish(suite.file.filepath);
|
|
159
|
+
if (this.workerState.config.snapshotOptions.updateSnapshot === "none" && result.unchecked) {
|
|
160
|
+
let message = `Obsolete snapshots found when no snapshot update is expected.\n`;
|
|
161
|
+
for (const key of result.uncheckedKeys) message += `· ${key}\n`;
|
|
162
|
+
suite.result.errors ??= [];
|
|
163
|
+
suite.result.errors.push(processError(new Error(message)));
|
|
164
|
+
suite.result.state = "fail";
|
|
165
|
+
}
|
|
158
166
|
await rpc().snapshotSaved(result);
|
|
159
167
|
}
|
|
160
168
|
this.workerState.current = suite.suite || suite.file;
|
package/dist/worker.js
CHANGED
|
@@ -6,7 +6,7 @@ import { readFileSync } from 'node:fs';
|
|
|
6
6
|
import { resolve, normalize } from 'pathe';
|
|
7
7
|
import { e as environments } from './chunks/index.CmSc2RE5.js';
|
|
8
8
|
import { s as setupInspect } from './chunks/inspector.C914Efll.js';
|
|
9
|
-
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc
|
|
9
|
+
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.CsFtxqeq.js';
|
|
10
10
|
import { i as isChildProcess, s as setProcessTitle } from './chunks/utils.XdZDrNZV.js';
|
|
11
11
|
import { d as disposeInternalListeners } from './chunks/utils.CAioKnHs.js';
|
|
12
12
|
import 'node:console';
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
2
|
+
import { r as runBaseTests } from '../chunks/base.Bj3pWTr1.js';
|
|
3
3
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.CAioKnHs.js';
|
|
4
4
|
import 'vite-node/client';
|
|
5
5
|
import '../chunks/execute.B7h3T_Hc.js';
|
|
@@ -6,16 +6,16 @@ import util from 'node:util';
|
|
|
6
6
|
import { startTests, collectTests } from '@vitest/runner';
|
|
7
7
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
8
8
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
|
-
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.
|
|
10
|
-
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.
|
|
11
|
-
import { V as VitestIndex } from '../chunks/index.
|
|
9
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.D-VkfKhf.js';
|
|
10
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.D7ZqXFx-.js';
|
|
11
|
+
import { V as VitestIndex } from '../chunks/index.BWf_gE5n.js';
|
|
12
12
|
import { c as closeInspector } from '../chunks/inspector.C914Efll.js';
|
|
13
13
|
import { g as getWorkerState } from '../chunks/utils.XdZDrNZV.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import 'node:path';
|
|
16
16
|
import '../path.js';
|
|
17
17
|
import 'node:url';
|
|
18
|
-
import '../chunks/rpc
|
|
18
|
+
import '../chunks/rpc.CsFtxqeq.js';
|
|
19
19
|
import '@vitest/utils';
|
|
20
20
|
import '../chunks/index.B521nVV-.js';
|
|
21
21
|
import '../chunks/coverage.DVF1vEu8.js';
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
1
|
+
import { r as runBaseTests } from '../chunks/base.Bj3pWTr1.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.CAioKnHs.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../chunks/execute.B7h3T_Hc.js';
|