1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { Context } from 'jest-runtime';
|
8 | import type { Config } from '@jest/types';
|
9 | import type { Test } from 'jest-runner';
|
10 | import type { ChangedFiles } from 'jest-changed-files';
|
11 | import type { Filter, Stats } from './types';
|
12 | export declare type SearchResult = {
|
13 | noSCM?: boolean;
|
14 | stats?: Stats;
|
15 | collectCoverageFrom?: Set<string>;
|
16 | tests: Array<Test>;
|
17 | total?: number;
|
18 | };
|
19 | export declare type TestSelectionConfig = {
|
20 | input?: string;
|
21 | findRelatedTests?: boolean;
|
22 | onlyChanged?: boolean;
|
23 | paths?: Array<Config.Path>;
|
24 | shouldTreatInputAsPattern?: boolean;
|
25 | testPathPattern?: string;
|
26 | watch?: boolean;
|
27 | };
|
28 | export default class SearchSource {
|
29 | private _context;
|
30 | private _dependencyResolver;
|
31 | private _testPathCases;
|
32 | constructor(context: Context);
|
33 | private _getOrBuildDependencyResolver;
|
34 | private _filterTestPathsWithStats;
|
35 | private _getAllTestPaths;
|
36 | isTestFilePath(path: Config.Path): boolean;
|
37 | findMatchingTests(testPathPattern?: string): SearchResult;
|
38 | findRelatedTests(allPaths: Set<Config.Path>, collectCoverage: boolean): SearchResult;
|
39 | findTestsByPaths(paths: Array<Config.Path>): SearchResult;
|
40 | findRelatedTestsFromPattern(paths: Array<Config.Path>, collectCoverage: boolean): SearchResult;
|
41 | findTestRelatedToChangedFiles(changedFilesInfo: ChangedFiles, collectCoverage: boolean): SearchResult;
|
42 | private _getTestPaths;
|
43 | getTestPaths(globalConfig: Config.GlobalConfig, changedFiles: ChangedFiles | undefined, filter?: Filter): Promise<SearchResult>;
|
44 | findRelatedSourcesFromTestsInChangedFiles(changedFilesInfo: ChangedFiles): Array<string>;
|
45 | }
|