diff --git a/.gitignore b/.gitignore index c9106a73f..1e59e82e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .nyc_output +coverage diff --git a/maintaining.md b/maintaining.md index dc1778a61..f67fcaef7 100644 --- a/maintaining.md +++ b/maintaining.md @@ -1,6 +1,13 @@ # Maintaining +## Testing + + - `npm test`: Lint the code and run the entire test suite with coverage. + - `npm run test-win`: Run the tests on Windows. + - `npm run coverage`: Generate a coverage report for the last test run (opens a browser window). + - `tap test/fork.js -b`: Run a specific test file and bail on the first failure (useful when hunting bugs). + ## Release process - Bump dependencies. diff --git a/package.json b/package.json index fc4f932bc..936c1882e 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,9 @@ }, "scripts": { "test": "xo && tap --coverage --reporter=spec --timeout=150 test/*.js", - "test-win": "tap --coverage --reporter=spec --timeout=150 test/*.js", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "test-win": "tap --reporter=spec --timeout=150 test/*.js", + "coveralls": "tap --coverage-report=text-lcov | coveralls", + "coverage": "tap --coverage-report=lcov" }, "files": [ "index.js", @@ -75,6 +76,14 @@ "observable", "observables" ], + "config": { + "nyc": { + "exclude": [ + "node_modules[/\\\\]", + "test[/\\\\]" + ] + } + }, "dependencies": { "arr-flatten": "^1.0.1", "ava-init": "^0.1.0", @@ -112,7 +121,6 @@ }, "devDependencies": { "coveralls": "^2.11.4", - "nyc": "^3.2.2", "signal-exit": "^2.1.2", "tap": "^2.2.1", "xo": "*",