Skip to content

Commit

Permalink
feat: update report
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Sep 28, 2024
1 parent 82ce3e5 commit fbd4e5b
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions packages/canyon-report/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ class CoverageReport {
return '{}';
}
})()

// 5. 核心,动态生成dynamic-data数据

generateDynamicData({coverage:cov})

// 3. 复制dist目录到当前工作目录
copyDirectory(sourceDir, targetDir);
// 4. 生成html文件,注入coverage-final.json的数据,需要一个summary列表
Expand Down
Empty file.
Empty file.
2 changes: 0 additions & 2 deletions packages/canyon-report/lib/reports/dynamic-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ function getDirectoryFromPath(filePath) {
return filePath.substring(0, filePath.lastIndexOf("/"));
}

// path.join(process.cwd(), "coverage")

const generateDynamicData = ({coverage}) => {
for (const key in JSON.parse(coverage)) {;
// 示例
Expand Down
2 changes: 0 additions & 2 deletions packages/canyon-report/lib/reports/template.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const libCoverage = require('istanbul-lib-coverage');


const generateHtml = ({coverage}) => {

var map = libCoverage.createCoverageMap(JSON.parse(coverage));
const obj = {}
map.files().forEach(function(f) {
Expand Down
4 changes: 2 additions & 2 deletions packages/canyon-report/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canyon-report7",
"version": "0.0.8-beta-20",
"name": "canyon-report",
"version": "0.0.8-beta-21",
"description": "My webpack project",
"main": "./lib/index.js",
"bin": "./lib/cli.js",
Expand Down

0 comments on commit fbd4e5b

Please sign in to comment.