SearchSource.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. import { Context } from 'jest-runtime';
  8. import { Config } from '@jest/types';
  9. import { Test } from 'jest-runner';
  10. import { ChangedFiles } from 'jest-changed-files';
  11. import { 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 _testPathCases;
  31. constructor(context: Context);
  32. private _filterTestPathsWithStats;
  33. private _getAllTestPaths;
  34. isTestFilePath(path: Config.Path): boolean;
  35. findMatchingTests(testPathPattern?: string): SearchResult;
  36. findRelatedTests(allPaths: Set<Config.Path>, collectCoverage: boolean): SearchResult;
  37. findTestsByPaths(paths: Array<Config.Path>): SearchResult;
  38. findRelatedTestsFromPattern(paths: Array<Config.Path>, collectCoverage: boolean): SearchResult;
  39. findTestRelatedToChangedFiles(changedFilesInfo: ChangedFiles, collectCoverage: boolean): SearchResult;
  40. private _getTestPaths;
  41. getTestPaths(globalConfig: Config.GlobalConfig, changedFiles: ChangedFiles | undefined, filter?: Filter): Promise<SearchResult>;
  42. }
  43. //# sourceMappingURL=SearchSource.d.ts.map