(dirPath: string)
| 2 | import path from 'node:path'; |
| 3 | |
| 4 | export const getFilePaths = (dirPath: string): Array<string> => { |
| 5 | let filePaths: Array<string> = []; |
| 6 | const files = fs.readdirSync(dirPath); |
| 7 | |
| 8 | for (const file of files) { |
| 9 | const filePath = path.join(dirPath, file); |
| 10 | const stat = fs.statSync(filePath); |
| 11 | |
| 12 | if (stat.isDirectory()) { |
| 13 | filePaths = filePaths.concat(getFilePaths(filePath)); |
| 14 | } else { |
| 15 | filePaths.push(filePath); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | return filePaths; |
| 20 | }; |
| 21 | |
| 22 | export const getSpecsPath = (): string => path.join(__dirname, '..', '..', 'specs'); |
no test coverage detected