(test)
| 17 | } |
| 18 | |
| 19 | async function tester (test) { |
| 20 | const promiseArray = [] |
| 21 | const rootPath = path.join(__dirname, '..', '..') |
| 22 | const eslint = new ESLint() |
| 23 | |
| 24 | const thisPath = path.join(__dirname, '..', '..', '**', '*.js').split(path.sep).join('/') |
| 25 | const jsFiles = globSync(thisPath, { absolute : true }) |
| 26 | |
| 27 | for ( const file of jsFiles ) { |
| 28 | const thisFile = path.relative(rootPath, file) |
| 29 | |
| 30 | if ( thisFile.startsWith('node_modules') || thisFile.startsWith('jsdoc_server') || thisFile.includes('inc') ) { |
| 31 | continue |
| 32 | } |
| 33 | |
| 34 | const problems = [] |
| 35 | |
| 36 | promiseArray.push(eslint.lintFiles(file).then((result) => { |
| 37 | if ( result[0].errorCount > 0 ) { |
| 38 | problems.push(`${result[0].errorCount} Errors`) |
| 39 | } |
| 40 | if ( result[0].warningCount > 0 ) { |
| 41 | problems.push(`${result[0].warningCount} Warnings`) |
| 42 | } |
| 43 | if ( problems.length !== 0 ) { |
| 44 | test.error(`${thisFile} has ${problems.join(' and ')}`) |
| 45 | } else { |
| 46 | test.step(`${thisFile} is clean`) |
| 47 | } |
| 48 | }).catch((err) => { |
| 49 | test.error(err) |
| 50 | })) |
| 51 | } |
| 52 | return Promise.all(promiseArray) |
| 53 | } |
no test coverage detected