diff options
author | sanine <sanine.not@pm.me> | 2022-05-29 14:50:55 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-05-29 14:50:55 -0500 |
commit | 3bc2838360627f78a91a7cad81f3bc97711410c2 (patch) | |
tree | 54d260b45895c1923a785efce817b94836660f35 /src/test.js | |
parent | d35e02ecdcef6d4f120bd572f2aae36b467b7761 (diff) |
refactor: move everything into src/ subdirectory
Diffstat (limited to 'src/test.js')
-rw-r--r-- | src/test.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test.js b/src/test.js new file mode 100644 index 0000000..6a92978 --- /dev/null +++ b/src/test.js @@ -0,0 +1,22 @@ +import fs from 'node:fs'; +import { execSync } from 'node:child_process'; + +function recursiveScanDir(path, f) +{ + let dirs = []; + for (let dirent of fs.readdirSync(path, { withFileTypes: true })) { + if (dirent.isDirectory()) dirs.push(`${path}/${dirent.name}`); + else f(`${path}/${dirent.name}`); + } + for (let dir of dirs) { + recursiveScanDir(dir, f); + } +} + +recursiveScanDir('.', fname => { + if (fname.endsWith('.test.js')) { + console.log(`======== ${fname} ========`); + execSync(`node ${fname}`, { stdio: 'inherit' }); + console.log(''); + } +}); |