UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

21 lines (16 loc) 463 B
import fg from 'fast-glob'; import { Path } from './Path'; export class FileFinder { constructor(private readonly cwd: Path) { } filesMatching(globPatterns: string[] | string | undefined): Path[] { if (! globPatterns) { return []; } return fg.sync(globPatterns, { cwd: this.cwd.value, absolute: true, unique: true, }).map((value: string) => new Path(value)); } }