There was an error while loading. Please reload this page.
1 parent 480868d commit f2a3f00Copy full SHA for f2a3f00
2 files changed
33-Building-a-Testing-Framework-From-Scratch/01-testme/index.js
@@ -1,3 +1,13 @@
1
#!/usr/bin/env node
2
3
-console.log('Running test!!.....');
+// console.log('Running test!!.....');
4
+
5
+const Runner = require('./runner');
6
+const runner = new Runner()
7
8
+const run = async () => {
9
+ const results = await runner.collectFiles(process.cwd()) // current working directory
10
+ console.log(results);
11
+}
12
13
+run()
33-Building-a-Testing-Framework-From-Scratch/01-testme/runner.js
@@ -1,10 +1,14 @@
+const fs = require('fs')
class Runner {
constructor() {
this.files = []
}
- collectFiles() {
-
+ async collectFiles(targetPath) {
+ const files = await fs.promises.readdir(targetPath)
+ return files
14
0 commit comments