Skip to content

Commit f2a3f00

Browse files
committed
Section 33: Implementing Breadth First Search
1 parent 480868d commit f2a3f00

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
#!/usr/bin/env node
22

3-
console.log('Running test!!.....');
3+
// 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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
const fs = require('fs')
2+
13
class Runner {
24
constructor() {
35
this.files = []
46
}
57

6-
collectFiles() {
7-
8+
async collectFiles(targetPath) {
9+
const files = await fs.promises.readdir(targetPath)
10+
11+
return files
812
}
913
}
1014

0 commit comments

Comments
 (0)