summaryrefslogtreecommitdiff
path: root/test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test.js')
-rw-r--r--test.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..b7c1e58
--- /dev/null
+++ b/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('./modules', fname => {
+ if (fname.endsWith('.test.js')) {
+ console.log(`======== ${fname} ========`);
+ execSync(`node ${fname}`, { stdio: 'inherit' });
+ console.log('');
+ }
+});