Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions register-istanbul.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ var writeOnExit = coverageVar == null ? true : null;
coffeeCoverage.register({
instrumentor: 'istanbul',
basePath: process.cwd(),
exclude: ['/test', '/node_modules', '/.git'],
exclude: ['/node_modules', '/.git', '/documentation', '/examples'],

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Author

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. :)

coverageVar: coverageVar,
writeOnExit: writeOnExit ? ((_ref = process.env.COFFEECOV_OUT) != null ? _ref : 'coverage/coverage-coffee.json') : null,
initAll: (_ref = process.env.COFFEECOV_INIT_ALL) != null ? (_ref === 'true') : true
});
});
3 changes: 3 additions & 0 deletions src/register.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ module.exports = (options={}) ->

replaceHandler = (extension) ->
origCoffeeHandler = require.extensions[extension]
# just expose needed API in some hideous way....
fs.instrumentFile ||= (fileName) ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we adding this to fs? O_o Seems like adding this to the main coffeeCoverage export would be a better plan?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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 fs... :p

compiledCache.get(fileName, -> instrumentFile(fileName))
require.extensions[extension] = (module, fileName) ->
if excludeFile fileName, options
return origCoffeeHandler.call this, module, fileName
Expand Down