diff --git a/.gitignore b/.gitignore index d3f2d20..28880c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules npm-debug.log -coverage \ No newline at end of file +coverage +.nyc_output diff --git a/.travis.yml b/.travis.yml index 0cf9b7e..8a6239b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,15 @@ +# Oh yeah! language: node_js + +# Add additional versions here as appropriate. node_js: - "stable" # Lint errors should trigger a failure. before_script: npm run lint +# Runs the coverage script (which runs the tests) +script: npm run cover + # Code coverage -after_success: - npm run coveralls \ No newline at end of file +after_success: npm run coveralls diff --git a/README.md b/README.md index f74f3d6..71bd2f8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Well, let me tell you! * `npm run test-watch`: Runs tests in watch-mode * `npm run lint`: Lints the code once * `npm run lint-watch`: Lints the code in watch-mode -* `npm run cover`: Runs code coverage using `istanbul` +* `npm run cover`: Runs code coverage using `nyc` (`istanbul`) * `npm run coveralls`: Used by coveralls ## Getting started @@ -34,7 +34,7 @@ Well, let me tell you! 1. Clone this repo, or download it as a zip * If you decide to clone, remove the `.git` folder so you don't get unnecessary git history. 2. Find and replace all occurences of `npm-module-boilerplate` and replace - it with your module name - filenames, too!. + it with your module name - filenames, too. You might also want to replace `jeffijoe` with your own Github username... Probably the LICENSE.md as well. :smile: 3. Edit `package.json`, `LICENSE.md` and `README.md` for your own needs. 4. `npm install` and start coding! open 2 terminals, one for linting (`npm run lint-watch`) and one for testing (`npm run test-watch`) - at least that's what I do. ;) 5. Write your code in `lib/npm-module-boilerplate.js` (this is the main file) diff --git a/package.json b/package.json index 02dc5bf..f9bede7 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,12 @@ "node": ">=4.0.0" }, "scripts": { - "test": "mocha test/**/*.js --require test/index.js", + "test": "mocha test/**/*.spec.js --require test/index.js", "test-watch": "npm run test -- --watch", "lint": "esw lib/ test/", "lint-watch": "npm run lint -- --watch", - "cover": "istanbul cover -x \"**example/**\" ./node_modules/mocha/bin/_mocha -- test/**/*.js --require test/index.js", - "coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- test/**/*.js --require test/index.js && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "cover": "nyc --reporter=lcov --reporter=text npm test", + "coveralls": "nyc report --reporter=text-lcov | coveralls", "do-publish": "npm run lint && npm run cover && npm publish" }, "repository": { @@ -34,10 +34,15 @@ "eslint-plugin-promise": "^2.0.1", "eslint-plugin-standard": "^2.0.0", "eslint-watch": "^2.1.14", - "istanbul": "^0.4.5", "mocha": "^3.0.2", + "nyc": "^8.1.0", "sinon": "^1.17.5", "sinon-chai": "^2.8.0" }, - "dependencies": {} + "dependencies": {}, + "nyc": { + "include": [ + "lib/**/*.js" + ] + } }