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

test(head): improve coverage #743

Merged
merged 1 commit into from Jun 18, 2017
Merged

test(head): improve coverage #743

merged 1 commit into from Jun 18, 2017

Conversation

nfischer
Copy link
Member

@nfischer nfischer commented Jun 18, 2017

This adds a test for head() on the right-hand side of a pipe. This also
removes the try-catch surrounding fs.openSync(), because it was unreachable
code. fs.existsSync() guarantees that the file exists, and fs.openSync()
only throws if the file does not exist, according to official documentation.

I see 100% line coverage for src/head.js when running:

$ nyc --reporter=text --reporter=lcov ava --serial test/head.js`

Fixes #741

This adds a test for `head()` on the right-hand side of a pipe. This also
removes the try-catch surrounding `fs.openSync()`, because it was unreachable
code. `fs.existsSync()` guarantees that the file exists, and `fs.openSync()`
only throws if the file does not exist, according to official documentation.

Fixes #671
@codecov-io
Copy link

codecov-io commented Jun 18, 2017

Codecov Report

Merging #743 into master will increase coverage by 0.23%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #743      +/-   ##
==========================================
+ Coverage   96.65%   96.89%   +0.23%     
==========================================
  Files          33       33              
  Lines        1227     1224       -3     
==========================================
  Hits         1186     1186              
+ Misses         41       38       -3
Impacted Files Coverage Δ
src/head.js 100% <100%> (+5.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c16fb7d...ad0b667. Read the comment docs.

@nfischer
Copy link
Member Author

No functional change, so self-LGTM

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

Successfully merging this pull request may close these issues.

None yet

2 participants