版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

143 lines
3.8 KiB

  1. import { a2 as BaseCoverageOptions, a1 as ResolvedCoverageOptions } from './types-94cfe4b4.js';
  2. import '@vitest/expect';
  3. import 'vite';
  4. import '@vitest/runner';
  5. import '@vitest/runner/types';
  6. import '@vitest/runner/utils';
  7. import '@vitest/utils';
  8. import 'tinybench';
  9. import 'vite-node/client';
  10. import 'node:worker_threads';
  11. import 'vite-node';
  12. import 'source-map';
  13. import 'node:fs';
  14. import 'vite-node/server';
  15. // Type definitions for istanbul-lib-coverage 2.0
  16. // Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
  17. // Definitions by: Jason Cheatham <https://github.com/jason0x43>
  18. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  19. // TypeScript Version: 2.4
  20. interface CoverageSummaryData {
  21. lines: Totals;
  22. statements: Totals;
  23. branches: Totals;
  24. functions: Totals;
  25. }
  26. declare class CoverageSummary {
  27. constructor(data: CoverageSummary | CoverageSummaryData);
  28. merge(obj: CoverageSummary): CoverageSummary;
  29. toJSON(): CoverageSummaryData;
  30. isEmpty(): boolean;
  31. data: CoverageSummaryData;
  32. lines: Totals;
  33. statements: Totals;
  34. branches: Totals;
  35. functions: Totals;
  36. }
  37. interface CoverageMapData {
  38. [key: string]: FileCoverage | FileCoverageData;
  39. }
  40. declare class CoverageMap {
  41. constructor(data: CoverageMapData | CoverageMap);
  42. addFileCoverage(pathOrObject: string | FileCoverage | FileCoverageData): void;
  43. files(): string[];
  44. fileCoverageFor(filename: string): FileCoverage;
  45. filter(callback: (key: string) => boolean): void;
  46. getCoverageSummary(): CoverageSummary;
  47. merge(data: CoverageMapData | CoverageMap): void;
  48. toJSON(): CoverageMapData;
  49. data: CoverageMapData;
  50. }
  51. interface Location {
  52. line: number;
  53. column: number;
  54. }
  55. interface Range {
  56. start: Location;
  57. end: Location;
  58. }
  59. interface BranchMapping {
  60. loc: Range;
  61. type: string;
  62. locations: Range[];
  63. line: number;
  64. }
  65. interface FunctionMapping {
  66. name: string;
  67. decl: Range;
  68. loc: Range;
  69. line: number;
  70. }
  71. interface FileCoverageData {
  72. path: string;
  73. statementMap: { [key: string]: Range };
  74. fnMap: { [key: string]: FunctionMapping };
  75. branchMap: { [key: string]: BranchMapping };
  76. s: { [key: string]: number };
  77. f: { [key: string]: number };
  78. b: { [key: string]: number[] };
  79. }
  80. interface Totals {
  81. total: number;
  82. covered: number;
  83. skipped: number;
  84. pct: number;
  85. }
  86. interface Coverage {
  87. covered: number;
  88. total: number;
  89. coverage: number;
  90. }
  91. declare class FileCoverage implements FileCoverageData {
  92. constructor(data: string | FileCoverage | FileCoverageData);
  93. merge(other: FileCoverageData): void;
  94. getBranchCoverageByLine(): { [line: number]: Coverage };
  95. getLineCoverage(): { [line: number]: number };
  96. getUncoveredLines(): number[];
  97. resetHits(): void;
  98. computeBranchTotals(): Totals;
  99. computeSimpleTotals(): Totals;
  100. toSummary(): CoverageSummary;
  101. toJSON(): object;
  102. data: FileCoverageData;
  103. path: string;
  104. statementMap: { [key: string]: Range };
  105. fnMap: { [key: string]: FunctionMapping };
  106. branchMap: { [key: string]: BranchMapping };
  107. s: { [key: string]: number };
  108. f: { [key: string]: number };
  109. b: { [key: string]: number[] };
  110. }
  111. type Threshold = 'lines' | 'functions' | 'statements' | 'branches';
  112. declare class BaseCoverageProvider {
  113. /**
  114. * Check if current coverage is above configured thresholds and bump the thresholds if needed
  115. */
  116. updateThresholds({ configurationFile, coverageMap, thresholds }: {
  117. coverageMap: CoverageMap;
  118. thresholds: Record<Threshold, number | undefined>;
  119. configurationFile?: string;
  120. }): void;
  121. /**
  122. * Resolve reporters from various configuration options
  123. */
  124. resolveReporters(configReporters: NonNullable<BaseCoverageOptions['reporter']>): ResolvedCoverageOptions['reporter'];
  125. }
  126. export { BaseCoverageProvider };