Skip to content

Commit

Permalink
Use istanbul babel plugin only in tests (#536)
Browse files Browse the repository at this point in the history
Prevents coverage instrumentation code from being
in the final package.

Fixes #535.
  • Loading branch information
Throne3d authored Mar 17, 2020
1 parent 9585a70 commit b3ebca5
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
}
]
],
"plugins": [
"istanbul"
]
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
}
52 changes: 52 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "babel lib --out-dir dist",
"prepare": "npm run build",
"lint": "eslint . --ignore-path .gitignore",
"coverage": "nyc --require @babel/register mocha -- 'test/*.test.js'",
"coverage": "cross-env NODE_ENV=test nyc --require @babel/register mocha -- 'test/*.test.js'",
"report": "nyc report --reporter=text-lcov | coveralls",
"test": "npm run lint && npm run coverage"
},
Expand Down Expand Up @@ -57,6 +57,7 @@
"babel-plugin-istanbul": "^5.2.0",
"chai": "^4.2.0",
"coveralls": "^3.0.9",
"cross-env": "^6.0.3",
"eslint": "^6.7.2",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.19.1",
Expand Down

0 comments on commit b3ebca5

Please sign in to comment.