From 053e8a0e3663300c46ceeda9171f0f860a01337f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Thu, 16 Jun 2016 02:42:24 -0400 Subject: [PATCH] Add code coverage --- .eslintignore | 2 ++ .gitignore | 4 ++++ .istanbul.yml | 8 ++++++++ .npmignore | 2 ++ .stylelintrc | 3 ++- package.json | 2 ++ 6 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .istanbul.yml diff --git a/.eslintignore b/.eslintignore index 83b83c3c..512bdec8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,3 +5,5 @@ client/js/lounge.templates.js # third party client/js/libs/jquery/*.js client/js/libs/*.js + +coverage/ diff --git a/.gitignore b/.gitignore index c23882f0..8b996fac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ +# Make sure to keep this file and .npmignore in sync + node_modules/ npm-debug.log +coverage/ + # Built assets created at npm install/prepublish time # See https://docs.npmjs.com/misc/scripts client/fonts/ diff --git a/.istanbul.yml b/.istanbul.yml new file mode 100644 index 00000000..e6e79229 --- /dev/null +++ b/.istanbul.yml @@ -0,0 +1,8 @@ +instrumentation: + include-all-sources: true + excludes: + - Gruntfile.js + - client/js/libs/*.js + - client/js/libs/jquery/*.js + - client/js/libs.min.js + - client/js/lounge.js diff --git a/.npmignore b/.npmignore index 3dfa1e0d..d8640d6c 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,5 @@ # This should match the .gitignore file without the generated assets # npm-debug.log and node_modules/ are ignored by default. # See https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package + +coverage/ diff --git a/.stylelintrc b/.stylelintrc index f569974a..d346c411 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,6 +1,7 @@ { "ignoreFiles": [ - "client/css/bootstrap.css" + "client/css/bootstrap.css", + "coverage/**/*.css" ], "rules": { "at-rule-empty-line-before": ["always", { diff --git a/package.json b/package.json index 85bde94c..195fc8c2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ }, "homepage": "https://thelounge.github.io/", "scripts": { + "coverage": "istanbul cover node_modules/mocha/bin/_mocha -r test/fixtures/env.js test/**/*.js", "start": "node index", "build": "npm run build:font-awesome && npm run build:grunt && npm run build:handlebars", "build:font-awesome": "node scripts/build-fontawesome.js", @@ -64,6 +65,7 @@ "grunt-contrib-uglify": "1.0.1", "grunt-contrib-watch": "1.0.0", "handlebars": "4.0.5", + "istanbul": "0.4.3", "mocha": "2.4.5", "npm-run-all": "2.1.1", "stylelint": "6.6.0"