12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-e98f203b.js';
- export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-e98f203b.js';
- import { UserConfig as UserConfig$1, Plugin } from 'vite';
- import 'tinybench';
- import 'fs';
- import 'worker_threads';
- declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1): Promise<Vitest>;
- declare function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise<Plugin[]>;
- declare type Key = string | symbol;
- interface ViteRunnerRequest {
- (dep: string): any;
- callstack: string[];
- }
- declare class VitestMocker {
- options: ExecuteOptions;
- private moduleCache;
- private request;
- private static pendingIds;
- private static spyModule?;
- constructor(options: ExecuteOptions, moduleCache: ModuleCacheMap, request: ViteRunnerRequest);
- private get root();
- private get base();
- private get mockMap();
- getSuiteFilepath(): string;
- getMocks(): {
- [x: string]: string | (() => unknown) | null;
- };
- private resolvePath;
- private resolveMocks;
- private callFunctionMock;
- private getMockPath;
- getDependencyMock(id: string): string | (() => unknown) | null;
- normalizePath(path: string): string;
- getFsPath(path: string, external: string | null): string;
- resolveMockPath(mockPath: string, external: string | null): string | null;
- mockObject(object: Record<string | symbol, any>): Record<Key, any>;
- unmockPath(path: string): void;
- mockPath(path: string, external: string | null, factory?: () => any): void;
- importActual<T>(id: string, importer: string): Promise<T>;
- importMock(id: string, importer: string): Promise<any>;
- private ensureSpy;
- requestWithMock(dep: string): Promise<any>;
- queueMock(id: string, importer: string, factory?: () => unknown): void;
- queueUnmock(id: string, importer: string): void;
- }
- interface ExecuteOptions extends ViteNodeRunnerOptions {
- mockMap: MockMap;
- }
- declare class VitestRunner extends ViteNodeRunner {
- options: ExecuteOptions;
- constructor(options: ExecuteOptions);
- prepareContext(context: Record<string, any>): Record<string, any> & {
- __vite_ssr_import__: (dep: string) => Promise<any>;
- __vite_ssr_dynamic_import__: (dep: string) => Promise<any>;
- __vitest_mocker__: VitestMocker;
- };
- }
- declare class BaseSequencer implements TestSequencer {
- protected ctx: Vitest;
- constructor(ctx: Vitest);
- shard(files: string[]): Promise<string[]>;
- sort(files: string[]): Promise<string[]>;
- }
- export { BaseSequencer, ExecuteOptions, VitestPlugin, VitestRunner, createVitest };
|