(dir, ext)
| 90 | |
| 91 | t.test('usage', async t => { |
| 92 | const readdir = async (dir, ext) => { |
| 93 | const files = await fs.readdir(dir, { withFileTypes: true }) |
| 94 | return files |
| 95 | .filter(f => { |
| 96 | // Include .js files |
| 97 | if (f.isFile() && extname(f.name) === ext) { |
| 98 | return true |
| 99 | } |
| 100 | // Include directories (which should have an index.js) |
| 101 | if (f.isDirectory()) { |
| 102 | return true |
| 103 | } |
| 104 | return false |
| 105 | }) |
| 106 | .map(f => f.isDirectory() ? f.name : basename(f.name, ext)) |
| 107 | } |
| 108 | |
| 109 | const fsCommands = await readdir(resolve(__dirname, '../../lib/commands'), '.js') |
| 110 | const docsCommands = await readdir(join(docs.paths.content, 'commands'), docs.DOC_EXT) |
no test coverage detected
searching dependent graphs…