From 24310699f5e2bd3af72e1257c1e0d12410d296b5 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Mon, 8 Jun 2015 12:17:50 -0400 Subject: [PATCH] chore(build): update babel and add code coverage task --- .gitignore | 3 ++- build/tasks/test.js | 21 +++++++++++++++++++++ package.json | 5 +++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 784886a..76489e1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules jspm_packages bower_components .idea -.DS_STORE \ No newline at end of file +.DS_STORE +build/reports diff --git a/build/tasks/test.js b/build/tasks/test.js index 84f5f29..7188475 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -23,3 +23,24 @@ gulp.task('tdd', function (done) { done(); }); }); + +/** + * Run test once with code coverage and exit + */ +gulp.task('cover', function (done) { + karma.start({ + configFile: __dirname + '/../../karma.conf.js', + singleRun: true, + reporters: ['coverage'], + preprocessors: { + 'test/**/*.js': ['babel'], + 'src/**/*.js': ['babel', 'coverage'] + }, + coverageReporter: { + type: 'html', + dir: 'build/reports/coverage' + } + }, function (e) { + done(); + }); +}); diff --git a/package.json b/package.json index 1fadb5e..afe07fe 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,11 @@ "jasmine-core": "^2.1.3", "jshint-stylish": "^1.0.0", "karma": "^0.12.28", - "karma-babel-preprocessor": "^5.1.0", + "karma-babel-preprocessor": "^5.2.1", "karma-chrome-launcher": "^0.1.7", + "karma-coverage": "^0.3.1", "karma-jasmine": "^0.3.5", - "karma-jspm": "^1.1.4", + "karma-jspm": "^1.1.5", "object.assign": "^1.0.3", "require-dir": "^0.1.0", "run-sequence": "^1.0.2",