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

Added Support for ES6 Coverage #142

Merged
merged 7 commits into from May 23, 2016
Merged

Added Support for ES6 Coverage #142

merged 7 commits into from May 23, 2016

Conversation

dwmkerr
Copy link
Contributor

@dwmkerr dwmkerr commented May 17, 2016

Hi Guys,

Here's a PR which adds coverage support.

Badge Support

Coverage badge added to the README.md. If the PR is accepted, the coveralls project should be changed to one Cory sets up (instructions for this are in the FAQ).

image

Optional integration with Coveralls

Support for the free-for-open-source coveralls tool, just check the FAQ.

image

Coverage commands

Just run npm run test:cover to generate a local HTML coverage report, open it up with open ./coverage/index.html.

Would love to know your thoughts. Fixes #108. Fixes #97.

Questions

Should we keep the coveralls support on by default, or have the users opt-in?

This was referenced May 17, 2016
@coveralls
Copy link

coveralls commented May 17, 2016

Coverage Status

Changes Unknown when pulling a5abbb2 on dwmkerr:master into * on coryhouse:master*.

@coryhouse
Copy link
Owner

This looks great! I'm at a conference so I'll need to look this over a bit later, but my only initial concern is that Isparta isn't actively maintained. I believe there are some good alternatives to consider.

Thanks so much!

@coryhouse
Copy link
Owner

One typo: "report is writtent to"

Also, I'm confused this reference:

Uncomment the line below if you have setup Coveralls as described in the FAQ.

The line is already uncommented in the commit, and would have to be uncommented for coveralls to work for us, right?

@dwmkerr
Copy link
Contributor Author

dwmkerr commented May 18, 2016

babel-plugin-coverage looks like it may fit the bill, although not yet particularly mature. There's a suggestion in the repo that these capabilities will come natively to istanbul. The 'uncomment' line is indeed confusing, I'll remove all of that

@dwmkerr
Copy link
Contributor Author

dwmkerr commented May 18, 2016

Although would you prefer the default for people to opt-in to coverage or opt-out?

@coryhouse
Copy link
Owner

Can you clarify the impact of opt-in by default?

@@ -17,6 +17,8 @@
"prebuild": "npm run clean-dist && npm run build:html && npm run lint && npm run test",
"build": "babel-node tools/build.js && npm run open:dist",
"test": "mocha tools/testSetup.js \"src/**/*.spec.js\" --reporter progress",
"test:cover": "babel-node $(npm bin)/isparta cover --root src --report html node_modules/mocha/bin/_mocha -- --require ./tools/testSetup.js \"src/**/*.spec.js\" --reporter progress",
"test:cover:travis": "babel-node ./node_modules/.bin/isparta cover --root src --report lcovonly node_modules/mocha/bin/_mocha -- --require ./tools/testSetup.js \"src/**/*.spec.js\" && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./node_modules/.bin is automatically added to $PATH for these scripts, babel-node isparta … should be enough. Same for test:cover

@coryhouse
Copy link
Owner

@dwmkerr - Can you clarify the impact of opt-in by default?

@dwmkerr
Copy link
Contributor Author

dwmkerr commented May 23, 2016

@coryhouse yes indeed, basically it means that if a user runs the build in travis, it will also attempt to then send the code coverage data (if the build is successful). If the user doesn't have a coveralls account it will fail to do so, let me get a quick screenshot of what that would look like

@coveralls
Copy link

coveralls commented May 23, 2016

Coverage Status

Changes Unknown when pulling 3cdd6af on dwmkerr:master into * on coryhouse:master*.

@dwmkerr
Copy link
Contributor Author

dwmkerr commented May 23, 2016

OK so even without coveralls enabled the build passes successfully (it just doesn't generate a report) so I think it's good to go if you want it, I've updated the documentation just now too

@coryhouse coryhouse merged commit f58f512 into coryhouse:master May 23, 2016
@coryhouse
Copy link
Owner

@dwmkerr Thanks so much! 👍

@coryhouse
Copy link
Owner

@dwmkerr FYI - I just committed a few tweaks to provide Windows support. Windows didn't like this:

$(npm bin)

I also removed some unnecessary explicit paths to node_modules, and fixed a few typos.

Thanks again! :)

@dwmkerr
Copy link
Contributor Author

dwmkerr commented May 24, 2016

@coryhouse great thanks for making the tweaks, I didn't have windows environment to test on!

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

4 participants