(cwd, filenames)
| 100 | } |
| 101 | |
| 102 | async testCommand(cwd, filenames) { |
| 103 | const start = Date.now() |
| 104 | const folder = this.resolvePath(cwd) |
| 105 | let target = cwd |
| 106 | let scrollErrors = [] |
| 107 | let fileCount = 0 |
| 108 | if (filenames && filenames.length) { |
| 109 | const files = await this.getFiles(cwd, filenames) |
| 110 | scrollErrors = await this.getErrorsInFiles(files) |
| 111 | target = filenames.join(" ") |
| 112 | fileCount = files.length |
| 113 | } else { |
| 114 | scrollErrors = await this.getErrorsInFolder(folder) |
| 115 | const files = await this._getFilesInFolder(folder) |
| 116 | fileCount = files.length |
| 117 | } |
| 118 | |
| 119 | const seconds = (Date.now() - start) / 1000 |
| 120 | |
| 121 | if (scrollErrors.length) { |
| 122 | this.log(``) |
| 123 | this.log(`❌ ${scrollErrors.length} errors in "${cwd}"`) |
| 124 | this.log(new Particle(scrollErrors).toFormattedTable(100)) |
| 125 | this.log(``) |
| 126 | } |
| 127 | if (!scrollErrors.length) return this.log(`✅ 0 errors in "${target}". ${fileCount} files tested in ${seconds} seconds.`) |
| 128 | return `${scrollErrors.length} Errors` |
| 129 | } |
| 130 | |
| 131 | async formatCommand(cwd, filenames) { |
| 132 | let files = [] |
no test coverage detected