Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test coverage #3984

Open
2 tasks done
curbengh opened this issue Dec 18, 2019 · 4 comments
Open
2 tasks done

Improve test coverage #3984

curbengh opened this issue Dec 18, 2019 · 4 comments

Comments

@curbengh
Copy link
Contributor

curbengh commented Dec 18, 2019

Check List

Please check followings before submitting a new feature request.

  • I have already read Docs page
  • I have already searched existing issues

Feature Request

This repo's unit test coverage currently stands at Coverage Status.

For anyone who is interested in improving it, there are a few ways:

  1. Search for "missing-unit-test" to locate functions that haven't been covered.
  2. Click on the coverage badge link and it shows all the relevant lines.
  3. Line coverage report is also shown in the CI job log.

hexo-util Coverage Status also needs help.

@NoahDragon NoahDragon mentioned this issue Dec 18, 2019
53 tasks
@seaoak
Copy link
Member

seaoak commented Dec 20, 2019

@curbengh Thank you for nice waking-up call!

I checked a "missing-unit-test" point of hexo-util.
https://github.com/hexojs/hexo-util/blob/master/test/highlight.spec.js#L172

I found that highlight() of hexo-util might not work well for illegal syntax codes.
highlight() of highlightjs package will throw an exception if source text is illegal syntax codes.
https://highlightjs.readthedocs.io/en/latest/api.html#highlight-languagename-code-ignore-illegals-continuation

But hexo-util/lib/highlight.js might not consider that case.

I continue to investigate this issue (and make new issue in the repo of hexo-util).

@SukkaW
Copy link
Member

SukkaW commented Jul 16, 2020

After #4422, the coverage has been increased from 97.03% to 98.26%.

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Aug 13, 2020

npx c8 report --reporter=lcov --reporter=text
File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 98.36 95.09 98.58 98.36
box 97.01 94.04 100 97.01
index.js 96.62 93.58 100 96.62 158,233-235,238-240,252-253
extend 99.48 96.41 100 99.48
filter.js 100 97.56 100 100 51
injector.js 100 92.68 100 100 53,64-69
processor.js 97.36 88.88 100 97.36 26
renderer.js 100 96.66 100 100 7
tag.js 98.82 95.45 100 98.82 230-232
hexo 98.75 95.45 98.93 98.75
index.js 98.99 95.91 96.15 98.99 154-155,336-338
load_config.js 100 91.3 100 100 36,56
load_plugins.js 97.59 94.44 100 97.59 57,76
multi_config_path.js 97.4 95.65 100 97.4 57-58
post.js 98.17 94.57 100 98.17 89-90,145-149,192
render.js 96.26 88.67 100 96.26 22-25,70
router.js 99.4 96.66 100 99.4 58
models 99.64 92.53 100 99.64
category.js 100 85 100 100 24,34,61
post.js 99.04 93.44 100 99.04 93,167
tag.js 100 83.33 100 100 13,18,52
models/types 100 95.45 100 100
moment.js 100 95.45 100 100 73,78
plugins/console 98.84 95.2 100 98.84
deploy.js 100 94.11 100 100 42
generate.js 97.48 93.1 100 97.48 102,136-137,143-144
new.js 95.83 90.9 100 95.83 26-27
render.js 100 87.5 100 100 33
plugins/console/list 76.25 90 60 76.25
common.js 89.47 75 100 89.47 14-15
index.js 92.3 75 100 92.3 22-23
post.js 92.68 83.33 50 92.68 7-9
route.js 15.09 100 0 15.09 5-16,18-34,36-51
plugins/filter/after_render 100 95.83 100 100
external_link.js 100 92.85 100 100 12
plugins/filter/before_post_render 100 94.73 100 100
backtick_code_block.js 100 93.54 100 100 23,89
plugins/generator 99.12 100 100 99.12
asset.js 97.77 100 100 97.77 28
format.js 100 100 0 100
list_archives.js 100 97.29 100 100 28
list_categories.js 100 91.48 100 100 11,55,87-95
list_posts.js 100 84.21 100 100 31,47-50
list_tags.js 100 92.3 100 100 12,80,82
number_format.js 100 93.75 100 100 33
open_graph.js 97.86 94.93 100 97.86 45,123-124,131
paginator.js 98.69 95.23 100 98.69 147-148
tagcloud.js 100 95.23 100 100 31,52
plugins/processor 95.7 89.18 100 95.7
asset.js 93.79 88.09 100 93.79 48-49,104-109
data.js 86.11 60 100 86.11 16-17,23-25
post.js 96.61 89.1 100 96.61 86-87,234-235,254-256,276-278
plugins/renderer 93.89 94.11 100 93.89
nunjucks.js 97.14 96 100 97.14 23-24
yaml.js 73.91 66.66 100 73.91 12-17
plugins/tag 100 95.18 100 100
blockquote.js 100 95.65 100 100 27
code.js 100 94.44 100 100 73,116-122
include_code.js 100 79.16 100 100 47,60-61,73,88
theme 100 94 100 100
index.js 100 90.9 100 100 73
view.js 100 94.87 100 100 10,117
theme/processors 96.84 92.85 100 96.84
i18n.js 100 80 100 100 18
source.js 91.17 91.66 100 91.17 16-18

@github-actions
Copy link

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants