-
-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Description
This issue introduced with 5.1.2
(5.1.1
and below are fine)
Reproduction repo: https://github.com/pi0/babel-plugin-istanbul-bug (Use yarn test
)
Reverting this change by #192 fixes problem.
Details
When using @babel/preset-env
:
import path from 'path'
function test() {
const _path = 'test'
return path.relative(__dirname, _path)
}
Transpiles into: (Correct)
var _path2 = _interopRequireDefault(require("path"));
function test() {
const _path = 'test';
return _path2.default.relative(__dirname, _path);
}
Using babel-plugin-istanbul@5.1.2
: (Bug)
var _path = _interopRequireDefault(require("path"));
function test() {
cov_1523mz691.f[0]++;
const _path = (cov_1523mz691.s[0]++, 'test');
cov_1523mz691.s[1]++;
return _path.default.relative(__dirname, _path);
}
Using babel-plugin-istanbul@5.1.1
(Correct)
var _path2 = _interopRequireDefault(require("path"));
function test() {
cov_1523mz691.f[0]++;
const _path = (cov_1523mz691.s[0]++, 'test');
cov_1523mz691.s[1]++;
return _path2.default.relative(__dirname, _path);
}
Metadata
Metadata
Assignees
Labels
No labels