Skip to content

Commit

Permalink
fix: address regression related to export const foo = () => {}
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Coe committed Jan 4, 2017
1 parent 73a4247 commit 3eaa7fb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
12 changes: 12 additions & 0 deletions fixtures/issue-78.js
@@ -0,0 +1,12 @@
export const updateName = (name) => {
return {
type: 'UPDATE_NAME',
name
}
}
export const updateName2 = (name) => {
return {
type: 'UPDATE_NAME',
name
}
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -10,7 +10,7 @@
],
"dependencies": {
"find-up": "^1.1.2",
"istanbul-lib-instrument": "^1.4.0",
"istanbul-lib-instrument": "^1.4.1",
"object-assign": "^4.1.0",
"test-exclude": "^3.3.0"
},
Expand Down
16 changes: 16 additions & 0 deletions test/babel-plugin-istanbul.js
Expand Up @@ -165,4 +165,20 @@ describe('babel-plugin-istanbul', function () {
})
})
}

// TODO: setup istanbul-lib-instrument, such that we can
// run various babel configurations.
context('regression tests', () => {
// regression test for https://github.com/istanbuljs/babel-plugin-istanbul/issues/78
it('should instrument: export const foo = () => {}', function () {
var result = babel.transformFileSync('./fixtures/issue-78.js', {
plugins: [
[makeVisitor({types: babel.types}), {
include: ['fixtures/issue-78.js']
}]
]
})
result.code.match(/statementMap/)
})
})
})

0 comments on commit 3eaa7fb

Please sign in to comment.