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

Allow the developer to opt out of instrumentation - enable browserify + buster + istanbul #6

Merged
merged 1 commit into from
Jul 25, 2013

Conversation

matthew-andrews
Copy link
Contributor

Hi @kates,

Firstly thanks for an amazing library. You can see how far I got implementing my own before I realised your's did almost everything I wanted, better.

Basically the background of this is for our projects we use browserify and buster.js.

The way @gotwarlost, author of Istanbul, suggests to use browserify with istanbul is to first instrument the individual javascript modules, then compile, then run the unit tests. This works beautifully - until you want to plug that into buster.js..

I tried to implement this bit myself (with some success) but afterwards realised that actually I'd made something that did almost the same things as this library - so it would probably be better to try to merge the two together.

It turns out merging them only required one tiny change - adding the option for the developer to opt out of the way your library automatically instruments the javascript files so that the instrumenting and compiling happen in steps before running the buster tests (I used grunt to run the tasks and grunt-istanbul to instrument (just) the files that I was interested in).

(Also we want to be able to put other types of code in the sources section of our buster.js config without having those instrumented (eg mocks, sample data, etc). - For this reason I've added the instrument: false option for node as well as browsers)

I've tried to keep my changes to a minimum and would be more than happy to tweak them to adhere to your preferred coding styles - just let me know what you would like to change.

Thanks again,

Matt

@kates
Copy link
Contributor

kates commented Jul 25, 2013

+1
Looks good to me.

// @mikaelkaron

mikaelkaron added a commit that referenced this pull request Jul 25, 2013
Allow the developer to opt out of instrumentation - enable browserify + buster + istanbul
@mikaelkaron mikaelkaron merged commit 367ce2b into englishtown:master Jul 25, 2013
@mikaelkaron
Copy link
Contributor

Looking good to me to so I'll merge this. Thanks @matthew-andrews for the patch!

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.

None yet

3 participants