版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { l as VitestRunMode, n as UserConfig, r as Vitest, aa as MockFactory, ab as MockMap, ac as TestSequencer } from './types-94cfe4b4.js';
  2. export { ac as TestSequencer, ae as TestSequencerConstructor, r as Vitest, ad as startVitest } from './types-94cfe4b4.js';
  3. import { UserConfig as UserConfig$1, Plugin } from 'vite';
  4. import { ViteNodeRunner } from 'vite-node/client';
  5. import { ViteNodeRunnerOptions } from 'vite-node';
  6. import '@vitest/expect';
  7. import '@vitest/runner';
  8. import '@vitest/runner/types';
  9. import '@vitest/runner/utils';
  10. import '@vitest/utils';
  11. import 'tinybench';
  12. import 'node:worker_threads';
  13. import 'source-map';
  14. import 'node:fs';
  15. import 'vite-node/server';
  16. declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1): Promise<Vitest>;
  17. declare function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise<Plugin[]>;
  18. type Key = string | symbol;
  19. declare class VitestMocker {
  20. executor: VitestExecutor;
  21. private static pendingIds;
  22. private resolveCache;
  23. constructor(executor: VitestExecutor);
  24. private get root();
  25. private get base();
  26. private get mockMap();
  27. private get moduleCache();
  28. private deleteCachedItem;
  29. getSuiteFilepath(): string;
  30. getMocks(): {
  31. [x: string]: string | MockFactory | null;
  32. };
  33. private resolvePath;
  34. private resolveMocks;
  35. private callFunctionMock;
  36. getMockPath(dep: string): string;
  37. getDependencyMock(id: string): string | MockFactory | null;
  38. normalizePath(path: string): string;
  39. resolveMockPath(mockPath: string, external: string | null): string | null;
  40. mockObject(object: Record<Key, any>, mockExports?: Record<Key, any>): Record<Key, any>;
  41. unmockPath(path: string): void;
  42. mockPath(originalId: string, path: string, external: string | null, factory?: MockFactory): void;
  43. importActual<T>(rawId: string, importee: string): Promise<T>;
  44. importMock(rawId: string, importee: string): Promise<any>;
  45. requestWithMock(url: string, callstack: string[]): Promise<any>;
  46. queueMock(id: string, importer: string, factory?: MockFactory): void;
  47. queueUnmock(id: string, importer: string): void;
  48. }
  49. interface ExecuteOptions extends ViteNodeRunnerOptions {
  50. mockMap: MockMap;
  51. }
  52. declare class VitestExecutor extends ViteNodeRunner {
  53. options: ExecuteOptions;
  54. mocker: VitestMocker;
  55. constructor(options: ExecuteOptions);
  56. shouldResolveId(id: string, _importee?: string | undefined): boolean;
  57. resolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>;
  58. dependencyRequest(id: string, fsPath: string, callstack: string[]): Promise<any>;
  59. prepareContext(context: Record<string, any>): Record<string, any>;
  60. }
  61. declare class BaseSequencer implements TestSequencer {
  62. protected ctx: Vitest;
  63. constructor(ctx: Vitest);
  64. shard(files: string[]): Promise<string[]>;
  65. sort(files: string[]): Promise<string[]>;
  66. }
  67. export { BaseSequencer, ExecuteOptions, VitestExecutor, VitestPlugin, createVitest };