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"