index.d.ts 1017 B

1234567891011121314151617181920212223242526272829303132333435
  1. import * as vitest from 'vitest';
  2. import { CoverageProvider, ResolvedCoverageOptions, CoverageC8Options } from 'vitest';
  3. import { Vitest } from 'vitest/node';
  4. declare class C8CoverageProvider implements CoverageProvider {
  5. name: string;
  6. ctx: Vitest;
  7. options: ResolvedCoverageOptions & {
  8. provider: 'c8';
  9. };
  10. initialize(ctx: Vitest): void;
  11. resolveOptions(): ({
  12. tempDirectory: string;
  13. } & Required<vitest.BaseCoverageOptions & {
  14. provider?: vitest.CoverageProviderModule | null | undefined;
  15. }> & {
  16. provider: "c8";
  17. }) | ({
  18. tempDirectory: string;
  19. } & Required<CoverageC8Options & {
  20. provider?: "c8" | undefined;
  21. }> & {
  22. provider: "c8";
  23. });
  24. onBeforeFilesRun(): void;
  25. clean(clean?: boolean): Promise<void>;
  26. onAfterSuiteRun(): void;
  27. reportCoverage(): Promise<void>;
  28. }
  29. declare function takeCoverage(): void;
  30. declare function getProvider(): Promise<C8CoverageProvider>;
  31. export { getProvider, takeCoverage };