Skip to content

Commit

Permalink
fix switch coverage pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Tamponi committed Nov 10, 2017
1 parent 11b3ddc commit 377a3fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 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"
if node.parent.type is "Assign" or node.parent.type is "Switch"
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"
if node.parent.type is "Assign" or node.parent.type is "Switch"
node = node.parent
else
node = node.parent.parent
Expand Down
1 change: 0 additions & 1 deletion test/mocha.opts
@@ -1,5 +1,4 @@
--compilers coffee:coffeescript/register
--require ./register-istanbul
--reporter spec
--recursive
--growl

0 comments on commit 377a3fe

Please sign in to comment.