Skip to content

Commit

Permalink
fix: a bit contrived, but updated to ES6 syntax that was handled poor…
Browse files Browse the repository at this point in the history
…ly by old Istanbul
  • Loading branch information
Benjamin Coe committed Jun 27, 2016
1 parent 2e1291b commit 6d8cfb4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
26 changes: 16 additions & 10 deletions test/fixtures/cli/es6.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
'use strict'

let probe = () => {
let missed = () => {
console.log('do not hit')
class Yarsay {
constructor() {
console.log('sup')
}
}

let b = () => {
console.log('hit this method')
}
hit() {
console.log('do not hit')
let miss = () => {
console.log('do not hit')
}
}

module.exports = () => {
console.log('do not hit')
miss() {
let miss = () => {
console.log('do not hit')
}
}
}

b()
let y = new Yarsay()
y.hit()
4 changes: 2 additions & 2 deletions test/src/nyc-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('the nyc cli', function () {
describe('coverage', function () {
if (parseInt(process.versions.node.split('.')[0]) < 4) return
it('reports appropriate coverage information for es6 source files', function (done) {
var args = [bin, process.execPath, './es6.js']
var args = [bin, '--reporter=lcov', '--reporter=text', process.execPath, './es6.js']

var proc = spawn(process.execPath, args, {
cwd: fixturesCLI,
Expand All @@ -289,7 +289,7 @@ describe('the nyc cli', function () {
proc.on('close', function (code) {
code.should.equal(0)
// we should miss covering the appropriate lines.
stdout.should.match(/4,5,14/)
stdout.should.match(/11,16,17/)
done()
})
})
Expand Down

0 comments on commit 6d8cfb4

Please sign in to comment.