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

Add Coverage report for Unit tests #1386

Closed
wants to merge 1 commit into from
Closed

Add Coverage report for Unit tests #1386

wants to merge 1 commit into from

Conversation

germanrcuriel
Copy link
Contributor

Fixes #361

Pre-requisites: Install JSCoverage (https://github.com/visionmedia/node-jscoverage)

I don't know what is the best way to get it installed automatically. Installing JSCoverage through a Grunt Task can be possible, but I think it's not the best way to do it.

@germanrcuriel
Copy link
Contributor Author

I think this is a way to install jscoverage being transparent to the user/developer. FYI https://github.com/vincent-zhao/sqlparser/pull/2/files

@ErisDS
Copy link
Member

ErisDS commented Nov 3, 2013

This looks pretty neat. I was under the impression doing this was much trickier than you've made it look! However, the setup you've added looks like it would only add coverage for the unit and not integration tests, might be worth considering adding an extra shell command for the integration tests?

Also, please take a sec to use git commit --amend and update the commit message to follow the guidelines, thanks 👍

issue #361
- Added shell:jscoverage task to convert library folder to generate coverage report with mocha
- Added shell:mocha_unit_coverage task to generate unit test coverage report
- Added shell:mocha_integration_coverage task to generate integration test coverage report
- Added clean:jscoverage task to remove converted folder when finished
- Registered test-coverage Grunt task to include all the above
- Added coverage files to .gitignore
@germanrcuriel
Copy link
Contributor Author

Updated and modified commit message following the guidelines. I created another shell task to generate integration test coverage report, and added it to test-coverage grunt task.

@ErisDS
Copy link
Member

ErisDS commented Nov 3, 2013

Does anyone have any experience of using this? I am still surprised by the ease, and also slightly concerned by how inactive node-jscoverage is. I haven't run the task in this PR yet, but it seems to me it shouldn't work very well on account of visionmedia/node-jscoverage#17 given how many index files we have.

@ErisDS
Copy link
Member

ErisDS commented Nov 3, 2013

Wondering if blanket and grunt-blanket might be a better solution in terms of being actively supported?

@germanrcuriel
Copy link
Contributor Author

I have experience with karma-runner using coverage reporter (https://github.com/karma-runner/karma-coverage). If you prefer use karma, I can do a new PR or update this one.

UPDATE: Karma doesn't work with server-side code.

@germanrcuriel
Copy link
Contributor Author

It seems you're right with node-jscoverage. It misses some files. I'll try to do it with blanket 😉

@ErisDS
Copy link
Member

ErisDS commented Nov 3, 2013

I'd like to hear if anyone has any experience with these things rather than jump into bed with an unknown

@ErisDS
Copy link
Member

ErisDS commented Nov 9, 2013

Seems no one has any opinions on this. If you're still up for implementing blanket go for it :D

@germanrcuriel
Copy link
Contributor Author

@ErisDS i made a new PR #1429. You can close this one 😉

@ErisDS ErisDS closed this Nov 10, 2013
@germanrcuriel germanrcuriel deleted the add-coverage-for-unit-tests branch November 10, 2013 16:46
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.

Infra: Code coverage
2 participants