vitest 0.1.18 → 0.1.23
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 +1 -1
- package/dist/cli.js +8 -7
- package/dist/create-38cbed6f.js +9156 -0
- package/dist/diff-1f9491ae.js +1367 -0
- package/dist/entry.js +135 -65
- package/dist/globals-7409dbab.js +23 -0
- package/dist/index-80a227f0.js +244 -0
- package/dist/index-ba307c22.js +9255 -0
- package/dist/{index-fb06fa81.js → index-cd6f3933.js} +2 -2
- package/dist/index.d.ts +68 -21
- package/dist/index.js +5 -4
- package/dist/node.d.ts +46 -20
- package/dist/node.js +6 -5
- package/dist/setup-458ce1c8.js +4393 -0
- package/dist/source-map-6a5e2318.js +3407 -0
- package/dist/{vi-b04d9662.js → vi-15ee265f.js} +24 -7
- package/dist/worker.js +269 -190
- package/{global.d.ts → globals.d.ts} +0 -0
- package/package.json +15 -13
- package/dist/create-9b6f7e20.js +0 -9141
- package/dist/diff-0d077da9.js +0 -4749
- package/dist/global-e5b6eef1.js +0 -22
- package/dist/index-46e1d4ad.js +0 -9275
- package/dist/index-f2daefb8.js +0 -267
- package/dist/setup-63fa6dd2.js +0 -4378
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-
|
|
1
|
+
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-15ee265f.js';
|
|
2
2
|
import chai, { assert, should } from 'chai';
|
|
3
3
|
import { s as spies, i as isMockFunction, a as spyOn, f as fn } from './jest-mock-113430de.js';
|
|
4
4
|
|
|
@@ -39,4 +39,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
export { afterAll as a, beforeAll as b, beforeEach as c, afterEach as d, expect as e, index as i };
|
|
42
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
42
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgtY2Q2ZjM5MzMuanMiLCJzb3VyY2VzIjpbIi4uL3NyYy9ydW50aW1lL2hvb2tzLnRzIiwiLi4vc3JjL2ludGVncmF0aW9ucy9jaGFpL2luZGV4LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgU3VpdGVIb29rcyB9IGZyb20gJy4uL3R5cGVzJ1xuaW1wb3J0IHsgZ2V0RGVmYXVsdEhvb2tUaW1lb3V0LCB3aXRoVGltZW91dCB9IGZyb20gJy4vY29udGV4dCdcbmltcG9ydCB7IGdldEN1cnJlbnRTdWl0ZSB9IGZyb20gJy4vc3VpdGUnXG5cbi8vIHN1aXRlIGhvb2tzXG5leHBvcnQgY29uc3QgYmVmb3JlQWxsID0gKGZuOiBTdWl0ZUhvb2tzWydiZWZvcmVBbGwnXVswXSwgdGltZW91dD86IG51bWJlcikgPT4gZ2V0Q3VycmVudFN1aXRlKCkub24oJ2JlZm9yZUFsbCcsIHdpdGhUaW1lb3V0KGZuLCB0aW1lb3V0ID8/IGdldERlZmF1bHRIb29rVGltZW91dCgpKSlcbmV4cG9ydCBjb25zdCBhZnRlckFsbCA9IChmbjogU3VpdGVIb29rc1snYWZ0ZXJBbGwnXVswXSwgdGltZW91dD86IG51bWJlcikgPT4gZ2V0Q3VycmVudFN1aXRlKCkub24oJ2FmdGVyQWxsJywgd2l0aFRpbWVvdXQoZm4sIHRpbWVvdXQgPz8gZ2V0RGVmYXVsdEhvb2tUaW1lb3V0KCkpKVxuZXhwb3J0IGNvbnN0IGJlZm9yZUVhY2ggPSAoZm46IFN1aXRlSG9va3NbJ2JlZm9yZUVhY2gnXVswXSwgdGltZW91dD86IG51bWJlcikgPT4gZ2V0Q3VycmVudFN1aXRlKCkub24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FBQzNCLE1BQU0sQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
|
package/dist/index.d.ts
CHANGED
|
@@ -228,26 +228,35 @@ declare class Any extends AsymmetricMatcher<any> {
|
|
|
228
228
|
toAsymmetricMatcher(): string;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
interface
|
|
232
|
-
file?: string;
|
|
233
|
-
sourceRoot?: string;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
interface RawSourceMap extends StartOfSourceMap {
|
|
237
|
-
version: string;
|
|
238
|
-
sources: string[];
|
|
239
|
-
names: string[];
|
|
240
|
-
sourcesContent?: string[];
|
|
241
|
-
mappings: string;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
interface ExternalizeOptions {
|
|
231
|
+
interface DepsHandlingOptions {
|
|
245
232
|
external?: (string | RegExp)[];
|
|
246
233
|
inline?: (string | RegExp)[];
|
|
234
|
+
/**
|
|
235
|
+
* Try to guess the CJS version of a package when it's invalid ESM
|
|
236
|
+
* @default true
|
|
237
|
+
*/
|
|
247
238
|
fallbackCJS?: boolean;
|
|
248
239
|
}
|
|
240
|
+
interface ViteNodeResolveId$1 {
|
|
241
|
+
external?: boolean | 'absolute' | 'relative';
|
|
242
|
+
id: string;
|
|
243
|
+
meta?: Record<string, any> | null;
|
|
244
|
+
moduleSideEffects?: boolean | 'no-treeshake' | null;
|
|
245
|
+
syntheticNamedExports?: boolean | string | null;
|
|
246
|
+
}
|
|
249
247
|
interface ViteNodeServerOptions {
|
|
250
|
-
|
|
248
|
+
/**
|
|
249
|
+
* Inject inline sourcemap to modules
|
|
250
|
+
* @default true
|
|
251
|
+
*/
|
|
252
|
+
sourcemap?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Deps handling
|
|
255
|
+
*/
|
|
256
|
+
deps?: DepsHandlingOptions;
|
|
257
|
+
/**
|
|
258
|
+
* Tranform method for modules
|
|
259
|
+
*/
|
|
251
260
|
transformMode?: {
|
|
252
261
|
ssr?: RegExp[];
|
|
253
262
|
web?: RegExp[];
|
|
@@ -267,6 +276,7 @@ declare class ViteNodeServer {
|
|
|
267
276
|
code: string | undefined;
|
|
268
277
|
externalize?: undefined;
|
|
269
278
|
}>;
|
|
279
|
+
resolveId(id: string, importer?: string): Promise<ViteNodeResolveId$1 | null>;
|
|
270
280
|
transformRequest(id: string): Promise<TransformResult | null | undefined>;
|
|
271
281
|
private getTransformMode;
|
|
272
282
|
private _transformRequest;
|
|
@@ -326,7 +336,7 @@ declare class Vitest {
|
|
|
326
336
|
private _onRestartListeners;
|
|
327
337
|
constructor();
|
|
328
338
|
setServer(options: UserConfig, server: ViteDevServer): Promise<void>;
|
|
329
|
-
getConfig():
|
|
339
|
+
getConfig(): ResolvedConfig;
|
|
330
340
|
start(filters?: string[]): Promise<void>;
|
|
331
341
|
private getTestDependencies;
|
|
332
342
|
filterTestsBySource(tests: string[]): Promise<string[]>;
|
|
@@ -502,6 +512,7 @@ interface C8Options {
|
|
|
502
512
|
include?: string[];
|
|
503
513
|
skipFull?: boolean;
|
|
504
514
|
extension?: string | string[];
|
|
515
|
+
all?: boolean;
|
|
505
516
|
}
|
|
506
517
|
interface ResolvedC8Options extends Required<C8Options> {
|
|
507
518
|
tempDirectory: string;
|
|
@@ -591,6 +602,12 @@ declare type Awaitable<T> = T | PromiseLike<T>;
|
|
|
591
602
|
declare type Nullable<T> = T | null | undefined;
|
|
592
603
|
declare type Arrayable<T> = T | Array<T>;
|
|
593
604
|
declare type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
|
|
605
|
+
declare type MergeInsertions<T> = T extends object ? {
|
|
606
|
+
[K in keyof T]: MergeInsertions<T[K]>;
|
|
607
|
+
} : T;
|
|
608
|
+
declare type DeepMerge<F, S> = MergeInsertions<{
|
|
609
|
+
[K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
|
|
610
|
+
}>;
|
|
594
611
|
interface Constructable {
|
|
595
612
|
new (...args: any[]): any;
|
|
596
613
|
}
|
|
@@ -639,6 +656,17 @@ interface ModuleGraphData {
|
|
|
639
656
|
externalized: string[];
|
|
640
657
|
inlined: string[];
|
|
641
658
|
}
|
|
659
|
+
interface StartOfSourceMap {
|
|
660
|
+
file?: string;
|
|
661
|
+
sourceRoot?: string;
|
|
662
|
+
}
|
|
663
|
+
interface RawSourceMap extends StartOfSourceMap {
|
|
664
|
+
version: string;
|
|
665
|
+
sources: string[];
|
|
666
|
+
names: string[];
|
|
667
|
+
sourcesContent?: string[];
|
|
668
|
+
mappings: string;
|
|
669
|
+
}
|
|
642
670
|
|
|
643
671
|
declare type ChainableFunction<T extends string, Args extends any[], R = any> = {
|
|
644
672
|
(...args: Args): R;
|
|
@@ -811,7 +839,7 @@ interface InlineConfig {
|
|
|
811
839
|
*
|
|
812
840
|
* @default true
|
|
813
841
|
*/
|
|
814
|
-
|
|
842
|
+
interopDefault?: boolean;
|
|
815
843
|
/**
|
|
816
844
|
* When a dependency is a valid ESM package, try to guess the cjs version based on the path.
|
|
817
845
|
* This will significantly improve the performance in huge repo, but might potentially
|
|
@@ -822,9 +850,13 @@ interface InlineConfig {
|
|
|
822
850
|
fallbackCJS?: boolean;
|
|
823
851
|
};
|
|
824
852
|
/**
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
853
|
+
* Register apis globally
|
|
854
|
+
*
|
|
855
|
+
* @default false
|
|
856
|
+
*/
|
|
857
|
+
globals?: boolean;
|
|
858
|
+
/**
|
|
859
|
+
* @deprecated
|
|
828
860
|
*/
|
|
829
861
|
global?: boolean;
|
|
830
862
|
/**
|
|
@@ -1027,6 +1059,14 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
|
|
|
1027
1059
|
api?: ApiConfig;
|
|
1028
1060
|
}
|
|
1029
1061
|
|
|
1062
|
+
interface ViteNodeResolveId {
|
|
1063
|
+
external?: boolean | 'absolute' | 'relative';
|
|
1064
|
+
id: string;
|
|
1065
|
+
meta?: Record<string, any> | null;
|
|
1066
|
+
moduleSideEffects?: boolean | 'no-treeshake' | null;
|
|
1067
|
+
syntheticNamedExports?: boolean | string | null;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1030
1070
|
interface WorkerContext {
|
|
1031
1071
|
port: MessagePort;
|
|
1032
1072
|
config: ResolvedConfig;
|
|
@@ -1037,8 +1077,10 @@ declare type FetchFunction = (id: string) => Promise<{
|
|
|
1037
1077
|
code?: string;
|
|
1038
1078
|
externalize?: string;
|
|
1039
1079
|
}>;
|
|
1080
|
+
declare type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
|
|
1040
1081
|
interface WorkerRPC {
|
|
1041
1082
|
fetch: FetchFunction;
|
|
1083
|
+
resolveId: ResolveIdFunction;
|
|
1042
1084
|
getSourceMap: (id: string, force?: boolean) => Promise<RawSourceMap | undefined>;
|
|
1043
1085
|
onWorkerExit: (code?: number) => void;
|
|
1044
1086
|
onUserConsoleLog: (log: UserConsoleLog) => void;
|
|
@@ -1143,6 +1185,7 @@ declare function fn<TArgs extends any[] = any[], R = any>(implementation: (...ar
|
|
|
1143
1185
|
declare class VitestUtils {
|
|
1144
1186
|
private _timers;
|
|
1145
1187
|
private _mockedDate;
|
|
1188
|
+
private _mocker;
|
|
1146
1189
|
constructor();
|
|
1147
1190
|
useFakeTimers(): void;
|
|
1148
1191
|
useRealTimers(): void;
|
|
@@ -1156,6 +1199,7 @@ declare class VitestUtils {
|
|
|
1156
1199
|
getMockedDate(): string | number | Date | null;
|
|
1157
1200
|
spyOn: typeof spyOn;
|
|
1158
1201
|
fn: typeof fn;
|
|
1202
|
+
private getImporter;
|
|
1159
1203
|
/**
|
|
1160
1204
|
* Makes all `imports` to passed module to be mocked.
|
|
1161
1205
|
* - If there is a factory, will return it's result. The call to `vi.mock` is hoisted to the top of the file,
|
|
@@ -1174,6 +1218,8 @@ declare class VitestUtils {
|
|
|
1174
1218
|
* @param path Path to the module. Can be aliased, if your config suppors it
|
|
1175
1219
|
*/
|
|
1176
1220
|
unmock(path: string): void;
|
|
1221
|
+
doMock(path: string, factory?: () => any): void;
|
|
1222
|
+
doUnmock(path: string): void;
|
|
1177
1223
|
/**
|
|
1178
1224
|
* Imports module, bypassing all checks if it should be mocked.
|
|
1179
1225
|
* Can be useful if you want to mock module partially.
|
|
@@ -1231,6 +1277,7 @@ interface WebSocketHandlers {
|
|
|
1231
1277
|
readFile(id: string): Promise<string>;
|
|
1232
1278
|
writeFile(id: string, content: string): Promise<void>;
|
|
1233
1279
|
rerun(files: string[]): Promise<void>;
|
|
1280
|
+
updateSnapshot(file: File): Promise<void>;
|
|
1234
1281
|
}
|
|
1235
1282
|
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onTaskUpdate' | 'onUserConsoleLog'> {
|
|
1236
1283
|
}
|
|
@@ -1339,4 +1386,4 @@ declare global {
|
|
|
1339
1386
|
}
|
|
1340
1387
|
}
|
|
1341
1388
|
|
|
1342
|
-
export { ApiConfig, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, Constructable, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, FetchFunction, File, HookListener, InlineConfig, JSDOMOptions, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MockWithArgs, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, ModuleGraphData, Nullable, ParsedStack, Position, Reporter, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, describe, expect, fn, isMockFunction, it, spies, spyOn, suite, test, vi, vitest };
|
|
1389
|
+
export { ApiConfig, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, Constructable, DeepMerge, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, FetchFunction, File, HookListener, InlineConfig, JSDOMOptions, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MergeInsertions, MockWithArgs, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, ModuleGraphData, Nullable, ParsedStack, Position, RawSourceMap, Reporter, ResolveIdFunction, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, StartOfSourceMap, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, describe, expect, fn, isMockFunction, it, spies, spyOn, suite, test, vi, vitest };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-
|
|
1
|
+
export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-15ee265f.js';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-cd6f3933.js';
|
|
3
3
|
export { f as fn, i as isMockFunction, s as spies, a as spyOn } from './jest-mock-113430de.js';
|
|
4
4
|
export { assert, default as chai, should } from 'chai';
|
|
5
|
-
import './index-
|
|
5
|
+
import './index-80a227f0.js';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
8
|
import './_commonjsHelpers-c9e3b764.js';
|
|
9
|
+
import './source-map-6a5e2318.js';
|
|
9
10
|
import 'tinyspy';
|
|
10
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7In0=
|
package/dist/node.d.ts
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
import { ViteDevServer, TransformResult, CommonServerOptions, UserConfig as UserConfig$1, Plugin as Plugin$1 } from 'vite';
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
file?: string;
|
|
5
|
-
sourceRoot?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface RawSourceMap extends StartOfSourceMap {
|
|
9
|
-
version: string;
|
|
10
|
-
sources: string[];
|
|
11
|
-
names: string[];
|
|
12
|
-
sourcesContent?: string[];
|
|
13
|
-
mappings: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface ExternalizeOptions {
|
|
3
|
+
interface DepsHandlingOptions {
|
|
17
4
|
external?: (string | RegExp)[];
|
|
18
5
|
inline?: (string | RegExp)[];
|
|
6
|
+
/**
|
|
7
|
+
* Try to guess the CJS version of a package when it's invalid ESM
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
19
10
|
fallbackCJS?: boolean;
|
|
20
11
|
}
|
|
12
|
+
interface ViteNodeResolveId {
|
|
13
|
+
external?: boolean | 'absolute' | 'relative';
|
|
14
|
+
id: string;
|
|
15
|
+
meta?: Record<string, any> | null;
|
|
16
|
+
moduleSideEffects?: boolean | 'no-treeshake' | null;
|
|
17
|
+
syntheticNamedExports?: boolean | string | null;
|
|
18
|
+
}
|
|
21
19
|
interface ViteNodeServerOptions {
|
|
22
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Inject inline sourcemap to modules
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
sourcemap?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Deps handling
|
|
27
|
+
*/
|
|
28
|
+
deps?: DepsHandlingOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Tranform method for modules
|
|
31
|
+
*/
|
|
23
32
|
transformMode?: {
|
|
24
33
|
ssr?: RegExp[];
|
|
25
34
|
web?: RegExp[];
|
|
@@ -39,6 +48,7 @@ declare class ViteNodeServer {
|
|
|
39
48
|
code: string | undefined;
|
|
40
49
|
externalize?: undefined;
|
|
41
50
|
}>;
|
|
51
|
+
resolveId(id: string, importer?: string): Promise<ViteNodeResolveId | null>;
|
|
42
52
|
transformRequest(id: string): Promise<TransformResult | null | undefined>;
|
|
43
53
|
private getTransformMode;
|
|
44
54
|
private _transformRequest;
|
|
@@ -284,6 +294,7 @@ interface C8Options {
|
|
|
284
294
|
include?: string[];
|
|
285
295
|
skipFull?: boolean;
|
|
286
296
|
extension?: string | string[];
|
|
297
|
+
all?: boolean;
|
|
287
298
|
}
|
|
288
299
|
interface ResolvedC8Options extends Required<C8Options> {
|
|
289
300
|
tempDirectory: string;
|
|
@@ -400,6 +411,17 @@ interface ErrorWithDiff extends Error {
|
|
|
400
411
|
expected?: any;
|
|
401
412
|
operator?: string;
|
|
402
413
|
}
|
|
414
|
+
interface StartOfSourceMap {
|
|
415
|
+
file?: string;
|
|
416
|
+
sourceRoot?: string;
|
|
417
|
+
}
|
|
418
|
+
interface RawSourceMap extends StartOfSourceMap {
|
|
419
|
+
version: string;
|
|
420
|
+
sources: string[];
|
|
421
|
+
names: string[];
|
|
422
|
+
sourcesContent?: string[];
|
|
423
|
+
mappings: string;
|
|
424
|
+
}
|
|
403
425
|
|
|
404
426
|
declare type RunMode = 'run' | 'skip' | 'only' | 'todo';
|
|
405
427
|
declare type TaskState = RunMode | 'pass' | 'fail';
|
|
@@ -528,7 +550,7 @@ interface InlineConfig {
|
|
|
528
550
|
*
|
|
529
551
|
* @default true
|
|
530
552
|
*/
|
|
531
|
-
|
|
553
|
+
interopDefault?: boolean;
|
|
532
554
|
/**
|
|
533
555
|
* When a dependency is a valid ESM package, try to guess the cjs version based on the path.
|
|
534
556
|
* This will significantly improve the performance in huge repo, but might potentially
|
|
@@ -539,9 +561,13 @@ interface InlineConfig {
|
|
|
539
561
|
fallbackCJS?: boolean;
|
|
540
562
|
};
|
|
541
563
|
/**
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
564
|
+
* Register apis globally
|
|
565
|
+
*
|
|
566
|
+
* @default false
|
|
567
|
+
*/
|
|
568
|
+
globals?: boolean;
|
|
569
|
+
/**
|
|
570
|
+
* @deprecated
|
|
545
571
|
*/
|
|
546
572
|
global?: boolean;
|
|
547
573
|
/**
|
|
@@ -798,7 +824,7 @@ declare class Vitest {
|
|
|
798
824
|
private _onRestartListeners;
|
|
799
825
|
constructor();
|
|
800
826
|
setServer(options: UserConfig, server: ViteDevServer): Promise<void>;
|
|
801
|
-
getConfig():
|
|
827
|
+
getConfig(): ResolvedConfig;
|
|
802
828
|
start(filters?: string[]): Promise<void>;
|
|
803
829
|
private getTestDependencies;
|
|
804
830
|
filterTestsBySource(tests: string[]): Promise<string[]>;
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { V as VitestPlugin, c as createVitest } from './create-
|
|
1
|
+
export { V as VitestPlugin, c as createVitest } from './create-38cbed6f.js';
|
|
2
2
|
import './index-1964368a.js';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'vite';
|
|
@@ -10,17 +10,18 @@ import 'os';
|
|
|
10
10
|
import 'util';
|
|
11
11
|
import 'stream';
|
|
12
12
|
import 'events';
|
|
13
|
-
import './index-
|
|
13
|
+
import './index-80a227f0.js';
|
|
14
14
|
import 'tty';
|
|
15
15
|
import 'local-pkg';
|
|
16
|
-
import './index-
|
|
16
|
+
import './index-ba307c22.js';
|
|
17
17
|
import 'module';
|
|
18
18
|
import 'assert';
|
|
19
19
|
import 'perf_hooks';
|
|
20
|
-
import './diff-
|
|
20
|
+
import './diff-1f9491ae.js';
|
|
21
|
+
import './source-map-6a5e2318.js';
|
|
21
22
|
import './index-648e7ab2.js';
|
|
22
23
|
import './_commonjsHelpers-c9e3b764.js';
|
|
23
24
|
import 'worker_threads';
|
|
24
25
|
import 'tinypool';
|
|
25
26
|
import './magic-string.es-94000aea.js';
|
|
26
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7In0=
|