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

Fix coverage of trailing function declaration #521

Merged
merged 3 commits into from Feb 18, 2016

Conversation

@rluba
Copy link
Contributor

rluba commented Feb 18, 2016

Declaring a function after a return statement causes lab to report the declaration as "not covered".

The new test demonstrates the problem: The old coverage code incorrectly reports lines 14 and 21 of test/coverage/trailing-function-declarations.js as "not covered". The fix in 2ba2d72 solves this problem by excluding function declarations from tracking.

rluba added 2 commits Feb 18, 2016
…ions

The current coverage code incorrectly reports lines 14 and 21 as "not covered"
They don’t need to be "executed" due to hoisting so adding coverage tracking code there creates false "not covered" lines
@rluba

This comment has been minimized.

Copy link
Contributor Author

rluba commented Feb 18, 2016

This PR will conflict with #520 because they both insert new tests at the same location in the test suite. Simply resolve it by arranging them in any order.

@geek

This comment has been minimized.

Copy link
Member

geek commented Feb 18, 2016

@rluba PR #520 is now merged if you want to rebase this

@geek geek added the bug label Feb 18, 2016
# Conflicts:
#	test/coverage.js
@rluba

This comment has been minimized.

Copy link
Contributor Author

rluba commented Feb 18, 2016

@geek Thx, I’ve resolved the conflict.

@geek geek added this to the 8.4.0 milestone Feb 18, 2016
@geek geek self-assigned this Feb 18, 2016
@geek

This comment has been minimized.

Copy link
Member

geek commented Feb 18, 2016

@rluba well done, looks great.

geek added a commit that referenced this pull request Feb 18, 2016
…laration

Fix coverage of trailing function declaration
@geek geek merged commit 663db6e into hapijs:master Feb 18, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.