ts-node-test
Version:
Use the Node.js test runner, but with TypeScript via ts-node
17 lines (16 loc) • 1.01 kB
TypeScript
import { PathLike } from 'node:fs';
/**
* Resolve a given set of (user-provided) input paths to explicit file names.
*
* Paths referring to singular files will be returned as-is, while paths referring to directories will be recursed into
* and the list of all deeply nested files will be returned.
*
* The resulting list will be filtered to only contain supported file extensions.
*
* @param paths The input paths.
* @param extensions The supported file extensions.
* @param readDirectory A function which can return the names of the files and folders in a directory (excluding '.' and '..')
* @returns An array containing all (matching and non-directory) file names explicitly.
*/
export declare function resolveTestPaths(paths: string[], extensions: string[], readDirectory?: (path: PathLike) => Promise<string[]>): Promise<string[]>;
export declare function walkPath(path: string, predicate: (fileName: string) => boolean, readDirectory: (path: PathLike) => Promise<string[]>): Promise<string[]>;