From 96551c20db5b3feca9d2c27a085288e894132dd2 Mon Sep 17 00:00:00 2001 From: etimberg Date: Sat, 13 Feb 2016 21:50:12 -0500 Subject: [PATCH] begin fixing coverage tests --- gulpfile.js | 3 ++- karma.coverage.conf.js | 8 ++++++-- package.json | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7b2710983..d0f9d08b9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -157,7 +157,8 @@ function unittestWatchTask() { } function coverageTask() { - var files = ['./dist/Chart.bundle.js'] + //var files = ['./dist/Chart.bundle.js'] + var files = ['./src/**/*.js']; Array.prototype.unshift.apply(files, preTestFiles); Array.prototype.push.apply(files, testFiles); diff --git a/karma.coverage.conf.js b/karma.coverage.conf.js index cc047aa4d..056b7e655 100644 --- a/karma.coverage.conf.js +++ b/karma.coverage.conf.js @@ -7,10 +7,14 @@ module.exports = function(config) { dir: 'coverage/' }, - frameworks: ['jasmine'], + frameworks: ['browserify', 'jasmine'], preprocessors: { - 'src/**/*.js': ['coverage'] + 'src/**/*.js': ['browserify', 'coverage'] + }, + browserify: { + debug: true, + transform: ['browserify-istanbul'] }, reporters: ['progress', 'coverage'], diff --git a/package.json b/package.json index 3f3602dcf..05b86f665 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "devDependencies": { "browserify": "^13.0.0", + "browserify-istanbul": "^0.2.1", "gulp": "3.9.x", "gulp-concat": "~2.1.x", "gulp-connect": "~2.0.5", @@ -26,7 +27,9 @@ "jasmine": "^2.3.2", "jasmine-core": "^2.3.4", "jquery": "^2.1.4", + "jshint-stylish": "~2.1.0", "karma": "^0.12.37", + "karma-browserify": "^5.0.1", "karma-chrome-launcher": "^0.2.0", "karma-coverage": "^0.5.1", "karma-firefox-launcher": "^0.1.6", @@ -34,8 +37,7 @@ "karma-jasmine-html-reporter": "^0.1.8", "merge-stream": "^1.0.0", "semver": "^3.0.1", - "vinyl-source-stream": "^1.1.0", - "jshint-stylish": "~2.1.0" + "vinyl-source-stream": "^1.1.0" }, "spm": { "main": "Chart.js" -- 2.47.3