(path: string)
| 12 | import { LocalDisk } from './local-disk.service'; |
| 13 | |
| 14 | function rmDirAndFilesIfExist(path: string) { |
| 15 | if (!existsSync(path)) { |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | const files = readdirSync(path); |
| 20 | for (const file of files) { |
| 21 | const stats = statSync(join(path, file)); |
| 22 | |
| 23 | if (stats.isDirectory()) { |
| 24 | rmDirAndFilesIfExist(join(path, file)); |
| 25 | } else { |
| 26 | unlinkSync(join(path, file)); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | rmdirSync(path); |
| 31 | } |
| 32 | |
| 33 | describe('LocalDisk', () => { |
| 34 |
no test coverage detected