(
initialOptions: Config.InitialOptions,
options: {
contextFiles?: Array<string>;
} = {},
)
| 42 | const toPaths = (tests: Array<Test>) => tests.map(({path}) => path); |
| 43 | |
| 44 | const initSearchSource = async ( |
| 45 | initialOptions: Config.InitialOptions, |
| 46 | options: { |
| 47 | contextFiles?: Array<string>; |
| 48 | } = {}, |
| 49 | ) => { |
| 50 | const {options: config} = await normalize(initialOptions, {} as Config.Argv); |
| 51 | const context = await Runtime.createContext(config, { |
| 52 | maxWorkers, |
| 53 | watchman: false, |
| 54 | }); |
| 55 | if (options.contextFiles) { |
| 56 | jest |
| 57 | .spyOn(context.hasteFS, 'getAllFiles') |
| 58 | .mockReturnValue(options.contextFiles); |
| 59 | } |
| 60 | return {config, searchSource: new SearchSource(context)}; |
| 61 | }; |
| 62 | |
| 63 | describe('SearchSource', () => { |
| 64 | const id = 'SearchSource'; |
no test coverage detected