(test)
| 79 | const tblHeader = '| ----------- | ----: | ----: | -----: | -----: | ---------: | -------: |' |
| 80 | |
| 81 | const countFiles = (test) => { |
| 82 | return glob('**', { cwd : path.join(__dirname, '..', '..'), ignore : 'node_modules/**', stat : true, withFileTypes : true }).then((results) => { |
| 83 | test.step(`Current App Version is ${pkgDetail.version}`) |
| 84 | test.step('Current File Statistics:\n') |
| 85 | const fileList = results.filter((x) => x.isFile()) |
| 86 | test.step_fmt(makeLine('', { blank : 'Blank', code : 'Code', comment : '/* */', size : 'Size', total : 'Files' })) |
| 87 | test.step_fmt(tblHeader) |
| 88 | test.step_fmt(makeLine('javaScript', countTextFile(fileList.filter((x) => path.extname(x.name) === '.js' && path.basename(x.name) !== 'baseGameData.js' && path.basename(x.name) !== 'baseGameData19.js'), true))) |
| 89 | test.step_fmt(makeLine('JSON', countTextFile(fileList.filter((x) => path.extname(x.name) === '.json')))) |
| 90 | test.step_fmt(makeLine('XML', countTextFile(fileList.filter((x) => path.extname(x.name) === '.xml')))) |
| 91 | test.step_fmt(makeLine('HTML', countTextFile(fileList.filter((x) => path.extname(x.name) === '.html')))) |
| 92 | test.step_fmt(makeLine('CSS', countTextFile(fileList.filter((x) => path.extname(x.name) === '.css' || path.extname(x.name) === '.scss'), true))) |
| 93 | test.step_fmt(makeLine('markDown', countTextFile(fileList.filter((x) => path.extname(x.name) === '.md')))) |
| 94 | test.step_fmt(makeLine('Images', countOthers(fileList.filter((x) => imgSet.has(path.extname(x.name)) )))) |
| 95 | test.step_fmt(makeLine('ZIP Archive', countOthers(fileList.filter((x) => path.extname(x.name) === '.zip')))) |
| 96 | test.step_fmt(makeLine('Other', countOthers(fileList.filter((x) => !knowSet.has(path.extname(x.name)) )))) |
| 97 | // test.step_fmt(tblHeader) |
| 98 | test.step_fmt(makeLine('TOTAL', countOthers(fileList))) |
| 99 | }).catch((err) => { |
| 100 | test.error(err) |
| 101 | }).finally(() => { |
| 102 | test.end() |
| 103 | }) |
| 104 | } |
no test coverage detected