diff --git a/.gitignore b/.gitignore index d5f19d8..b07ff2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules package-lock.json +coverage diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3da72bc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: node_js +node_js: + - "9" + - "8" + - "6" + - "4" +script: + - "npm run test-travis" +after_script: + - "npm install coveralls && cat coverage/lcov.info | coveralls" +matrix: + fast_finish: true +notifications: + irc: + channels: + - "irc.freenode.org#bigpipe" + on_success: change + on_failure: change diff --git a/package.json b/package.json index 0e60fa0..2232e05 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,11 @@ "description": "Cross platform environment variables with process.env, window.name, location.hash and localStorage fallbacks", "main": "index.js", "scripts": { - "test": "mocha test.js" + "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "test": "mocha test.js", + "watch": "mocha --watch test.js", + "coverage": "istanbul cover ./node_modules/.bin/_mocha -- test.js", + "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js" }, "repository": { "type": "git", @@ -29,6 +33,7 @@ "homepage": "https://github.com/3rd-Eden/env-variable", "devDependencies": { "assume": "^2.0.1", - "mocha": "^5.1.1" + "mocha": "^5.1.1", + "istanbul": "^0.4.5" } }