Skip to content

Commit

Permalink
fix class Pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Tamponi committed Nov 10, 2017
1 parent 377a3fe commit 150014b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SkipVisitor.coffee
Expand Up @@ -17,7 +17,7 @@ PRAGMAS = [
fn: (self, node, match, options={}) ->
origNode = node
if node.type is "Value"
if node.parent.type is "Assign" or node.parent.type is "Switch"
if node.parent.type is "Assign" or node.parent.type is "Switch" or node.parent.type is "Class"
node = node.parent
else
node = node.parent.parent
Expand Down Expand Up @@ -54,7 +54,7 @@ PRAGMAS = [
regex: /^!pragma\s+no-coverage-next$/
fn: (self, node, match, options={}) ->
if node.type is "Value"
if node.parent.type is "Assign" or node.parent.type is "Switch"
if node.parent.type is "Assign" or node.parent.type is "Switch" or node.parent.type is "Class"
node = node.parent
else
node = node.parent.parent
Expand Down
1 change: 1 addition & 0 deletions src/coffeeCoverage.coffee
Expand Up @@ -358,6 +358,7 @@ exports._runInstrumentor = (instrumentor, fileName, source, options={}) ->
# Compile the instrumented CoffeeScript and write it to the JS file.
try
js = ast.compile coffeeOptions
console.log js
catch err
### !pragma coverage-skip-block ###
throw new CoverageError("Could not compile #{fileName} after instrumenting: #{err.stack}")
Expand Down

0 comments on commit 150014b

Please sign in to comment.