Files
rea/tests/support/workspace/listFixtureFiles.ts
T
Vincent Koc 78149eeec9 refactor(tests): consolidate repeated CLI capture and fixture construction (#14311)
* refactor(tests): consolidate repeated CLI capture and fixture construction

* test(cli): keep overlapping schema and help cases in their existing PR
2026-11-24 08:53:50 +00:00

14 lines
416 B
TypeScript

import { readdir } from "node:fs/promises";
import { join, sep } from "node:path";
export const listFixtureFiles = async (root: string): Promise<string[]> =>
(await readdir(root, { recursive: true, withFileTypes: true }))
.filter((entry) => entry.isFile())
.map((entry) =>
join(entry.parentPath, entry.name)
.slice(root.length + 1)
.split(sep)
.join("/"),
)
.sort();