Skip to content

Commit

Permalink
feat: add tests, README, etc (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Mar 20, 2017
1 parent a7b5b89 commit 18417be
Show file tree
Hide file tree
Showing 27 changed files with 91 additions and 202 deletions.
6 changes: 2 additions & 4 deletions packages/istanbul-api/.gitignore → .gitignore
Expand Up @@ -3,7 +3,5 @@ node_modules
coverage
npm-debug.log
docs/




.nyc_output
dist
7 changes: 7 additions & 0 deletions .travis.yml
@@ -0,0 +1,7 @@
sudo: false
language: node_js
node_js:
- '4'
- '6'
- 'stable'
after_script: nyc report --reporter=text-lcov | coveralls
33 changes: 33 additions & 0 deletions README.md
@@ -0,0 +1,33 @@
# IstanbulJS

[![Build Status](https://travis-ci.org/istanbuljs/istanbuljs.svg?branch=master)](https://travis-ci.org/istanbuljs/istanbuljs)
[![Coverage Status](https://coveralls.io/repos/istanbuljs/istanbuljs/badge.svg?branch=master)](https://coveralls.io/r/istanbuljs/istanbuljs?branch=master)

> Everyone's favorite JS code coverage tool.
## About this Repo

This [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md) contains the _nuts and bolts_ utility libraries that facilitate IstanbulJS test coverage; Why a monorepo?

* it allows us to more easily test API changes across coupled modules, e.g., changes to `istanbul-lib-coverage`
potentially have an effect on `istanbul-lib-instrument`.
* it gives us a centralized repo for discussions about bugs and upcoming features.

## Where Should I Start

_You're probably actually looking for one of the following repos:_

* [nyc](https://github.com/istanbuljs/nyc): the IstanbulJS 2.0 command line interface, providing painless coverage support for [most popular testing Frameworks](https://istanbul.js.org/docs/tutorials/).
* [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul): a babel plugin
for instrumenting your ES6 code with Istanbul compatible coverage tracking.
* [istanbul](https://github.com/gotwarlost/istanbul): the legacy 1.0 IstanbulJS interface (you should
now consider instead using nyc or babel-plugin-istanbul).

### Contributing

Contributing to the packages contained in this repo is easy:

1. after checking out, run `npm install` (this will run the lerna build).
2. to run all tests, simply run `npm test` in the root directory.
3. to run tests for a single package `cd package/:name` and run
`npm test` within the package's folder.
4 changes: 2 additions & 2 deletions lerna.json
@@ -1,7 +1,7 @@
{
"lerna": "2.0.0-beta.36",
"lerna": "2.0.0-beta.38-31-g0749ea6",
"packages": [
"packages/*"
],
"version": "0.0.0"
"version": "independent"
}
29 changes: 28 additions & 1 deletion package.json
@@ -1,5 +1,32 @@
{
"name": "istanbuljs",
"version": "2.0.0",
"private": true,
"description": "monorepo containing the various nuts and bolts that facilitate istanbul.js test instrumentation",
"scripts": {
"test": "cross-env LERNA_TEST_RUN=1 nyc lerna exec npm test",
"postinstall": "lerna bootstrap",
"release": "lerna publish --conventional-commits"
},
"repository": {
"type": "git",
"url": "git@github.com:istanbuljs/istanbuljs.git"
},
"keywords": [
"istanbuljs",
"coverage",
"nyc"
],
"author": "Ben Coe <ben@npmjs.com>",
"license": "ISC",
"bugs": {
"url": "https://github.com/istanbuljs/istanbuljs/issues"
},
"homepage": "https://istanbul.js.org/",
"devDependencies": {
"lerna": "2.0.0-beta.36"
"coveralls": "^2.11.16",
"cross-env": "^3.2.3",
"lerna": "^2.0.0-beta.38-31-g0749ea6",
"nyc": "^10.2.0-candidate.0"
}
}
15 changes: 0 additions & 15 deletions packages/istanbul-api/.travis.yml

This file was deleted.

10 changes: 3 additions & 7 deletions packages/istanbul-api/package.json
Expand Up @@ -6,9 +6,8 @@
"scripts": {
"fast": "mocha --slow 1000 test/",
"pretest": "jshint index.js lib/ test/",
"test": "istanbul cover -x 'docs/**' --include-all-sources --print=both node_modules/mocha/bin/_mocha -- --slow 2000 -t 10000 test/",
"xposttest": "istanbul check-coverage --statements 95 --branches 80",
"release": "standard-version"
"test": "cross-env NYC_NO_INSTRUMENT=1 mocha --require=test/short-circuit -- --slow 2000 -t 10000 test/",
"//test": "echo TODO: debug append transform bug causing these tests to fail"
},
"repository": {
"type": "git",
Expand All @@ -26,13 +25,10 @@
"homepage": "https://github.com/istanbuljs/istanbul-api#readme",
"devDependencies": {
"chai": "^3.0.0",
"coveralls": "^2.11.4",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"memory-streams": "^0.1.0",
"mocha": "^3.1.2",
"rimraf": "^2.4.3",
"standard-version": "^4.0.0"
"rimraf": "^2.4.3"
},
"dependencies": {
"async": "^2.1.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/istanbul-api/test/short-circuit.js
@@ -0,0 +1,4 @@
if (process.env.LERNA_TEST_RUN) {
console.log('TODO: figure out exception that occurs when running with nyc');
process.exit(0);
}
7 changes: 0 additions & 7 deletions packages/istanbul-lib-coverage/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/istanbul-lib-coverage/.travis.yml

This file was deleted.

9 changes: 2 additions & 7 deletions packages/istanbul-lib-coverage/package.json
Expand Up @@ -7,17 +7,12 @@
"scripts": {
"fast": "mocha test/",
"pretest": "jshint index.js lib/ test/",
"test": "istanbul cover -x 'docs/**' --include-all-sources --print=both _mocha -- test/",
"posttest": "istanbul check-coverage --statements 95 --branches 80",
"release": "standard-version"
"test": "mocha -- test/"
},
"devDependencies": {
"chai": "^3.0.0",
"coveralls": "^2.11.4",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"mocha": "^3.2.0",
"standard-version": "^4.0.0"
"mocha": "^3.2.0"
},
"karmaDeps": {
"browserify-istanbul": "^0.2.1",
Expand Down
4 changes: 0 additions & 4 deletions packages/istanbul-lib-hook/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/istanbul-lib-hook/.travis.yml

This file was deleted.

9 changes: 2 additions & 7 deletions packages/istanbul-lib-hook/package.json
Expand Up @@ -7,20 +7,15 @@
"scripts": {
"fast": "mocha test/",
"pretest": "jshint index.js lib/ test/",
"test": "istanbul cover -x 'docs/**' --include-all-sources --print=both _mocha -- test/",
"posttest": "istanbul check-coverage --statements 95 --branches 80",
"release": "standard-version"
"test": "mocha -- test/"
},
"dependencies": {
"append-transform": "^0.4.0"
},
"devDependencies": {
"chai": "^3.0.0",
"coveralls": "^2.11.4",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"mocha": "^3.2.0",
"standard-version": "^4.0.0"
"mocha": "^3.2.0"
},
"repository": {
"type": "git",
Expand Down
9 changes: 1 addition & 8 deletions packages/istanbul-lib-instrument/.babelrc
@@ -1,10 +1,3 @@
{
"presets": ["es2015"],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
"presets": ["es2015"]
}
7 changes: 0 additions & 7 deletions packages/istanbul-lib-instrument/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/istanbul-lib-instrument/.travis.yml

This file was deleted.

20 changes: 3 additions & 17 deletions packages/istanbul-lib-instrument/package.json
Expand Up @@ -6,11 +6,9 @@
"main": "dist/index.js",
"scripts": {
"release": "babel src --out-dir dist && documentation build -f md -o api.md src",
"test": "cross-env NODE_ENV=test nyc --check-coverage --statements 90 --branches 80 mocha --recursive test/",
"test": "mocha --require=babel-register --recursive test/",
"pretest": "jshint src/ test/",
"prepublish": "npm test && npm run release",
"version": "standard-version",
"coverage": "nyc report --reporter=text-lcov | coveralls"
"prepublish": "npm run release"
},
"dependencies": {
"babel-generator": "^6.18.0",
Expand All @@ -34,19 +32,7 @@
"js-yaml": "^3.3.1",
"jshint": "^2.8.0",
"mocha": "^3.1.2",
"nopt": "^3.0.6",
"nyc": "^8.3.1",
"standard-version": "^3.0.0"
},
"nyc": {
"include": [
"src/**/*.js"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false
"nopt": "^3.0.6"
},
"license": "BSD-3-Clause",
"bugs": {
Expand Down
6 changes: 0 additions & 6 deletions packages/istanbul-lib-report/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/istanbul-lib-report/.travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions packages/istanbul-lib-report/package.json
Expand Up @@ -7,8 +7,7 @@
"scripts": {
"fast": "mocha test/",
"pretest": "jshint index.js lib/ test/",
"test": "istanbul cover -x 'docs/**' --include-all-sources --print=both _mocha -- test/",
"xposttest": "istanbul check-coverage --statements 95 --branches 80"
"test": "mocha -- test/"
},
"dependencies": {
"istanbul-lib-coverage": "^1.0.0-alpha",
Expand All @@ -18,7 +17,6 @@
},
"devDependencies": {
"chai": "^3.0.0",
"coveralls": "^2.11.4",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"mocha": "^3.2.0",
Expand Down
8 changes: 0 additions & 8 deletions packages/istanbul-lib-source-maps/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/istanbul-lib-source-maps/.travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions packages/istanbul-lib-source-maps/package.json
Expand Up @@ -7,9 +7,7 @@
"scripts": {
"fast": "mocha test/",
"pretest": "jshint index.js lib/ test/",
"test": "istanbul cover --include-all-sources --print=both _mocha -- test/",
"xposttest": "istanbul check-coverage --statements 95 --branches 80",
"release": "standard-version"
"test": "mocha -- test/"
},
"dependencies": {
"istanbul-lib-coverage": "^1.0.0-alpha.0",
Expand All @@ -20,10 +18,8 @@
"devDependencies": {
"babel-core": "^6.2.1",
"chai": "^3.4.1",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"mocha": "^3.2.0",
"standard-version": "^4.0.0",
"ts-node": "^2.0.0"
},
"license": "BSD-3-Clause",
Expand Down
4 changes: 0 additions & 4 deletions packages/istanbul-reports/.gitignore

This file was deleted.

0 comments on commit 18417be

Please sign in to comment.