diff options
author | Rob Loach <robloach@gmail.com> | 2015-06-05 09:39:14 -0400 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2015-06-05 09:39:14 -0400 |
commit | 591a3ecd3ab34011c95370224a5845261217ce2e (patch) | |
tree | 4a76e83a320ab31b987a4998d0ed4e79857f5584 | |
parent | a6d26854b18d66fdb89c3c97ddb369245ec8fbab (diff) | |
download | jquery-once-591a3ecd3ab34011c95370224a5845261217ce2e.zip jquery-once-591a3ecd3ab34011c95370224a5845261217ce2e.tar.gz jquery-once-591a3ecd3ab34011c95370224a5845261217ce2e.tar.bz2 |
Add Coverage with Istanbul
-rw-r--r-- | .gitignore | 31 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | package.json | 6 | ||||
-rw-r--r-- | test/index.js | 18 |
4 files changed, 28 insertions, 29 deletions
@@ -1,28 +1,5 @@ -# v1.3.10 December 10, 2013 -# https://github.com/bevry/base - -# Temp Files **/*.log -**/.docpad.db - -# Build Files -build/ -components/ -bower_components/ -node_modules/ -out/ - -# Private Files -.env -.idea -.cake_task_cache - - -# ===================================== -# CUSTOM MODIFICATIONS - -Cakefile -CONTRIBUTING.md -coffeelint.json -.jshintrc -cyclic.js +/components +/bower_components +/node_modules +/coverage diff --git a/.travis.yml b/.travis.yml index 4e7812d..48648f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,3 +11,5 @@ cache: notifications: email: false + +after_success: npm run coveralls diff --git a/package.json b/package.json index 2289103..3b4584c 100644 --- a/package.json +++ b/package.json @@ -52,10 +52,12 @@ }, "scripts": { "pretest": "eslint jquery.once.js test/test.js", - "test": "mocha", + "test": "mocha test/test.js", "docs": "jsdoc2md jquery.once.js > API.md", "build": "uglifyjs jquery.once.js -o jquery.once.min.js --comments --source-map jquery.once.min.js.map --mangle", - "package": "npm install && npm run test && npm run projectz && npm run docs && npm run build" + "package": "npm install && npm run test && npm run docs && npm run build", + "coverage": "npm i istanbul && istanbul cover test", + "coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls" }, "files": [ "jquery.once.js", diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..2cfadb1 --- /dev/null +++ b/test/index.js @@ -0,0 +1,18 @@ +/** + * Mocha test runner. + */ +var Mocha = require('mocha'); +var path = require('path'); + +// Create our mocha instance. +var mocha = new Mocha; + +// Add all the test files. +mocha.addFile(path.join(__dirname, 'test.js')); + +// Run the tests. +mocha.run(function(failures){ + process.on('exit', function () { + process.exit(failures); + }); +}); |