SBoudrias / gulp-istanbul

Istanbul unit test coverage plugin for gulp.
MIT License
186 stars 87 forks source link

Using instrumented code in browser #105

Closed miller5984 closed 8 years ago

miller5984 commented 8 years ago

This is not an issue with the code itself and I apologize since this isn't the area to ask this kind of question but I haven't been able to come up with any solutions and my question on stack overflow has gone unanswered. I am using gulp and gulp-istanbul to run protractor tests to test coverage in my application. If I understand everything, I need to instrument all files that the browser uses (client side javascript) so that I can run the coverage tests, correct?

If that's correct, then my next question is how do I require these files in my tests? Do I just use the require keyword and require the files as a variable? My problem is I have about 30 files containing the code I need to test, and I'm not sure where to begin.

SBoudrias commented 8 years ago

To be honest, you'd be better to use a browser testing tool like Karma supporting coverage.

You could probably still use gulp-istanbul with karma, but it'd be way easier to just set it up all together.

miller5984 commented 8 years ago

Thank you for the input. This is the solution I was thinking it was going to end up being.