Skip to content

Commit

Permalink
feat: deno task cov:view (denoland#558)
Browse files Browse the repository at this point in the history
The `cov:view` task generates HTML to view LCOV files using
[`genhtml`](https://linux.die.net/man/1/genhtml) and then opens the main
page in the local machine's browser. This is good for analysing test
coverage locally. The `cov` task has also been renamed to `cov:gen`.
  • Loading branch information
iuioiua authored Sep 10, 2023
1 parent 471fb52 commit 6379ddd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: deno task ok

- name: Create lcov file
run: deno task cov
run: deno task cov:gen

- name: Upload coverage
uses: codecov/codecov-action@v3
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ cov/
cov.lcov
.idea
_fresh/
backup.json
backup.json
html_cov/
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"check:license": "deno run --allow-read --allow-write tasks/check_license.ts",
"check:types": "deno check **/*.ts && deno check **/*.tsx",
"ok": "deno fmt --check && deno lint && deno task check:license --check && deno task check:types && deno task test",
"cov": "deno coverage ./cov/ --lcov --exclude='test.ts' > cov.lcov",
"cov:gen": "deno coverage ./cov/ --lcov --exclude='test.ts' > cov.lcov",
"cov:view": "genhtml -o html_cov cov.lcov && open html_cov/index.html",
"update": "deno run -A -r https://fresh.deno.dev/update .",
"build": "deno run -A --unstable dev.ts build",
"preview": "deno run -A --unstable main.ts"
Expand Down

0 comments on commit 6379ddd

Please sign in to comment.