This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Tweak package scripts and travis config for code coverage

  • Loading branch information...
existentialism committed Mar 10, 2017
1 parent 707bf10 commit 1bc62357772f022a93b0d7354c1abaa41cb336bc
Showing with 39 additions and 16 deletions.
  1. +8 −3 .travis.yml
  2. +20 −6 CONTRIBUTING.md
  3. +11 −7 package.json
View
@@ -13,8 +13,11 @@ node_js:
- '0.12'
- '0.10'
env:
- PKG_CMD="npm"
- PKG_CMD="yarn"
global:
- BABEL_ENV=test
matrix:
- PKG_CMD="npm"
- PKG_CMD="yarn"
before_install:
- nvm use $TRAVIS_NODE_VERSION
- npm set loglevel error
@@ -24,7 +27,7 @@ install:
- $PKG_CMD install
script:
- 'if [ -n "${LINT-}" ]; then $PKG_CMD run lint ; fi'
- 'if [ -z "${LINT-}" ]; then $PKG_CMD run ci ; fi'
- 'if [ -z "${LINT-}" ]; then $PKG_CMD run test-ci ; fi'
matrix:
fast_finish: true
exclude:
@@ -35,3 +38,5 @@ matrix:
include:
- node_js: "node"
env: LINT=true PKG_CMD="npm"
after_success: 'if [ -z "${LINT-}" ]; then npm run coverage-ci ; fi'
View
@@ -1,8 +1,8 @@
## Contributing
# Contributing
### Adding a new plugin to support (when approved in the next ECMAScript version)
## Adding a new plugin to support (when approved in the next ECMAScript version)
#### Update [`plugin-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js)
### Update [`plugin-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js)
*Example:*
@@ -27,7 +27,7 @@ And add them in this structure:
},
```
#### Update [`built-in-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js)
### Update [`built-in-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js)
*Example:*
@@ -51,15 +51,29 @@ const es2017 = {
}
```
#### Update [`plugins.json`](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json)
### Update [`plugins.json`](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json)
Until `compat-table` is a standalone npm module for data we are using the git url
`"compat-table": "kangax/compat-table#[latest-commit-hash]"`,
So we update and then run `npm run build-data`. If there are no changes, then `plugins.json` will be the same.
### Writing Tests
## Tests
### Running tests locally
```bash
npm test
```
### Checking code coverage locally
```bash
npm run coverage
```
### Writing tests
#### General
View
@@ -10,13 +10,15 @@
"scripts": {
"build": "rimraf lib && babel src -d lib",
"build-data": "node ./scripts/build-data.js",
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'",
"coverage": "BABEL_ENV=test nyc npm run test",
"coverage-ci": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
"dev": "babel -w src -d lib",
"lint": "eslint .",
"fix": "eslint . --fix",
"cov": "BABEL_ENV=test nyc npm run test",
"ci": "npm run cov && nyc report --reporter=json && codecov -f coverage/coverage-final.json",
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'",
"test": "npm run build && mocha ./test --compilers js:babel-register -t 10000"
"lint": "eslint .",
"test": "npm run build && npm run test-only",
"test-ci": "nyc npm run test",
"test-only": "mocha ./test --compilers js:babel-register -t 10000"
},
"dependencies": {
"babel-plugin-check-es2015-constants": "^6.3.13",
@@ -55,7 +57,7 @@
"babel-eslint": "^7.1.1",
"babel-helper-fixtures": "^6.22.0",
"babel-helper-plugin-test-runner": "^6.18.0",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-istanbul": "^3.1.2",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
@@ -91,6 +93,8 @@
},
"nyc": {
"all": true,
"include": ["src/*.js"]
"include": ["src/*.js"],
"instrument": false,
"sourceMap": false
}
}

0 comments on commit 1bc6235

Please sign in to comment.