From 6a768101fa295c9069fbdeb13e0b028f808e6582 Mon Sep 17 00:00:00 2001 From: Matt DuVall Date: Sun, 1 Sep 2013 22:48:51 -0700 Subject: [PATCH] Add coverage for QUnit via Istanbul --- .gitignore | 1 + Gruntfile.js | 18 +++++++++++++++++- package.json | 3 ++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 344040e..3589a51 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ _SpecRunner.html bin/coverage node_modules/ .DS_Store +report/ diff --git a/Gruntfile.js b/Gruntfile.js index d413171..635dc66 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,21 @@ module.exports = function(grunt) { - grunt.initConfig({}); + grunt.initConfig({ + qunit: { + options: { + "--web-security": "no", + coverage: { + src: ["js/grande.js"], + instrumentedFiles: "temp/", + htmlReport: "report/coverage", + coberturaReport: "report/", + linesThresholdPct: 85 + } + }, + all: ["test/**.html"] + } + }); + + grunt.loadNpmTasks("grunt-qunit-istanbul"); }; diff --git a/package.json b/package.json index bad4f3f..89b407e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "istanbul": "~0.1.10", "sinon": "*", "grunt": "~0.4.1", - "qunitjs": "*" + "qunitjs": "*", + "grunt-qunit-istanbul": "*" }, "keywords": [ "ui",