Skip to content

Commit

Permalink
start supporting coffeescript 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Tamponi committed Nov 9, 2017
1 parent 4fbbfd6 commit fdf999e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
@@ -1,5 +1,5 @@
{
"name": "coffee-coverage",
"name": "coffee-coverage-v2",
"description": "Istanbul and JSCoverage-style instrumentation for CoffeeScript files.",
"keywords": [
"javascript",
Expand All @@ -12,7 +12,7 @@
"jscoverage",
"coveralls"
],
"version": "2.0.1",
"version": "2.0.2",
"author": "Benbria (http://www.benbria.com/)",
"contributors": [
"Jason Walton <dev@lucid.thedreaming.org> (https://github.com/jwalton)",
Expand Down Expand Up @@ -52,14 +52,14 @@
"sinon": "^1.14.1"
},
"scripts": {
"prepublish": "npm run build",
"prepublish": "npm run build && mocha",
"test": "npm run build && mocha && istanbul report",
"coverage-report": "istanbul report text-summary lcov",
"build": "coffee -c -o lib src",
"clean": "rm -rf lib coverage",
"distclean": "npm run clean && rm -rf node_modules"
},
"engines": {
"node": ">=0.8.0"
"node": ">=8.9.0"
}
}
5 changes: 3 additions & 2 deletions src/coffeeCoverage.coffee
Expand Up @@ -25,8 +25,9 @@ exports.INSTRUMENTORS = INSTRUMENTORS = {
}

class CoverageError extends Error
constructor: (@message) ->
super message
constructor: (message) ->
super()
@message = message
@name = "CoverageError"
Error.captureStackTrace this, arguments.callee

Expand Down
6 changes: 6 additions & 0 deletions src/instrumentors/Istanbul.coffee
Expand Up @@ -148,6 +148,12 @@ module.exports = class Istanbul
# Called on each non-comment statement within a Block. If a `visitXXX` exists for the
# specific node type, it will also be called after `visitStatement`.
visitStatement: (node) ->
grandParentType = node.parent?.parent?.node?.constructor?.name

if grandParentType is "StringWithInterpolations" and !node.parent.parent.skipped
node.parent.parent.skipped = true
return

# Ignore nodes marked 'noCoverage'
return if node.isMarked('noCoverage')

Expand Down

0 comments on commit fdf999e

Please sign in to comment.