test(head): improve coverage by nfischer · Pull Request #743 · shelljs/shelljs

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