avoidwork / filesize.js

JavaScript library to generate a human readable String describing the file size
https://filesizejs.com
BSD 3-Clause "New" or "Revised" License
1.61k stars 97 forks source link

Code coverage tool (Istanbul) added. #57

Closed HeikkiAlanen closed 9 years ago

HeikkiAlanen commented 9 years ago

Hello, As a part of our Node.js course we are studying unit testing and tools for measuring code coverage. So I picked your module and added code coverage tool called Istanbul to your module. See https://www.npmjs.org/package/istanbul

Istanbul creates coverage-folder where the results are placed. In coverage/lcov-report folder you can find index.html which provides visual presentation of the code coverage.

To run code coverage tool: npm run-script coverage

avoidwork commented 9 years ago

Hi,

Thanks, but this implementation doesn't fit the workflow. Nothing executes npm run-script coverage, so this should be done via grunt, with a module like grunt-istanbul, or grunt-istanbul-coverage. You would then add it to the test definition, such that it's executed during the build process (local & on travis-ci.org).

I've never used istanbul, so I'm curious about it's accuracy. It reports 2/3 functions used, but there is only one?

avoidwork commented 9 years ago

Closing due to a lack of response.