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

Coverage #540

Merged
merged 7 commits into from
Aug 24, 2020
Merged

Coverage #540

merged 7 commits into from
Aug 24, 2020

Conversation

brettz9
Copy link
Contributor

@brettz9 brettz9 commented Aug 18, 2020

Some improvements for (else branch) coverage, bringing two files up to full 100% coverage. Also fixes a linting warning.

  • feedhandler: overcome lint warning
  • test(WritableStream): cover else branch
  • test(Parser): cover (open-implies-close case of) onclosetag else branch with non-br void close tag in non-XML mode
  • refactor: improve else coverage by avoiding openImpliesClose optional chaining operator (check for existence already made upon entering block)
  • refactor: improve coverage by avoiding null check for endIndex (since by calling _updatePosition, it will never be null). Cast endIndex as number to avoid TS believing it could be null.

@coveralls
Copy link

coveralls commented Aug 18, 2020

Coverage Status

Coverage remained the same at 98.601% when pulling 75f563e on brettz9:coverage into ea6ceb0 on fb55:master.

@brettz9
Copy link
Contributor Author

brettz9 commented Aug 18, 2020

The coverage percent decrease is apparently due to my having eliminated the need for two previously covered lines (while having increased coverage elsewhere only for else branches). So this is actually an improvement in coverage with no true coverage regression.

…anch with non-`br` void close tag in non-XML mode
…al chaining operator (check for existence already made upon entering block)
…ce by calling `_updatePosition`, it will never be `null`). Cast endIndex as number to avoid TS believing it could be null.
Copy link
Owner

@fb55 fb55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some great changes. I'd love to see a test case actually check its outputs, but then we should be good to go here!

src/Parser.spec.ts Outdated Show resolved Hide resolved
@fb55 fb55 merged commit 6d8a2ff into fb55:master Aug 24, 2020
@fb55
Copy link
Owner

fb55 commented Aug 24, 2020

Hi @brettz9, made the change mentioned above & merged the PR. Thank you for this (as well as #543), great way to contribute to a project.

@brettz9
Copy link
Contributor Author

brettz9 commented Aug 24, 2020

Thank you! Apologies I couldn't carry it through myself--great if it may help however slightly to your great project! :-)

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

Successfully merging this pull request may close these issues.

3 participants