Skip to content

Commit

Permalink
Fix coverage reports
Browse files Browse the repository at this point in the history
Using nyc to instrument the files lead to false negatives, not to mention
incorrect call count for lines in the HTML report. Switched to
babel-plugin-istanbul.

Had to move the `excluded` stanza from `.nycrc` to `.babelrc` because of
istanbuljs/babel-plugin-istanbul#62
  • Loading branch information
Adam committed Jan 30, 2017
1 parent af0b445 commit 1f178b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
"env": {
"development": {
"presets": ["react-hmre"]
},

"tests": {
"plugins": [
["istanbul", {
"exclude": [
"tests/unit/**/*.js"
]
}]
]
}
}
}
7 changes: 4 additions & 3 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"src/**/*.js",
"src/**/*.jsx"
],
"exclude": [
"tests/unit/**/*.js"
],
"extension": [".js", ".jsx"],

"sourceMap": false,
"instrument": false,

"reporter": ["html"],

"lines": 100,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"babel-core": "~6.22.1",
"babel-eslint": "~7.1.1",
"babel-loader": "~6.2.4",
"babel-plugin-istanbul": "~3.1.2",
"babel-plugin-transform-class-properties": "~6.9.0",
"babel-plugin-transform-object-rest-spread": "~6.20.2",
"babel-preset-es2015": "~6.9.0",
Expand Down

0 comments on commit 1f178b9

Please sign in to comment.