-
Notifications
You must be signed in to change notification settings - Fork 28
[wip] Expose needed API for coffeescript's self-coverage #81
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,9 @@ module.exports = (options={}) -> | |
|
|
||
| replaceHandler = (extension) -> | ||
| origCoffeeHandler = require.extensions[extension] | ||
| # just expose needed API in some hideous way.... | ||
| fs.instrumentFile ||= (fileName) -> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we adding this to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jwalton you're absolutely correct. :) At that time, I was just trying the stuff to work.. So, I abused the |
||
| compiledCache.get(fileName, -> instrumentFile(fileName)) | ||
| require.extensions[extension] = (module, fileName) -> | ||
| if excludeFile fileName, options | ||
| return origCoffeeHandler.call this, module, fileName | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is '/test/' not excluded anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is my personal preference.. It's that the code coverage of test files should be available too.
That's because there have been countless times when the new-written tests are not correctly run in my development.. Under aggressive development things progress at a rapid pace, so it's be difficult to be careful always to every detail.
Also, because coverage information can be provided as a no additional manual effort, this can be useful for time-effective just hurried-up investigation to fix something wrong as much quick as possible.
Under that situation, just seeing if coverages are intentionally collected is just a plus, I think. :) Also, as a developer, while doing TDD, it's always fun to see my laboured code painted as green regardless of application or test code.
Anyway, that's my two cents. I'm persuading no one. Before the wip status got removed, I'll revert this change. :)