From 89a2b5215f751f9e048a2eb4056aa8a2d81dc960 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 9 Feb 2017 22:56:04 -0800 Subject: [PATCH] feat(aio): enhance unit test experience with karma-jasmine-html-reporter See related [PR 4567](https://github.com/angular/angular-cli/pull/4567) in `angular-cli` --- aio/karma.conf.js | 8 ++++++-- aio/package.json | 1 + aio/yarn.lock | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/aio/karma.conf.js b/aio/karma.conf.js index 7514d2237bec4..5dc0e438c10a1 100644 --- a/aio/karma.conf.js +++ b/aio/karma.conf.js @@ -7,9 +7,13 @@ module.exports = function (config) { plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), // 'kjhtml' require('karma-remap-istanbul'), require('@angular/cli/plugins/karma') ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, files: [ { pattern: './src/test.ts', watched: false } ], @@ -30,8 +34,8 @@ module.exports = function (config) { environment: 'dev' }, reporters: config.angularCli && config.angularCli.codeCoverage - ? ['progress', 'karma-remap-istanbul'] - : ['progress'], + ? ['progress', 'karma-remap-istanbul'] //, 'kjhtml'] + : ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/aio/package.json b/aio/package.json index c62ac3027764b..49ec560e8a11a 100644 --- a/aio/package.json +++ b/aio/package.json @@ -52,6 +52,7 @@ "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", + "karma-jasmine-html-reporter": "^0.2.2", "karma-remap-istanbul": "^0.2.1", "lodash": "^4.17.4", "protractor": "~4.0.13", diff --git a/aio/yarn.lock b/aio/yarn.lock index d12421297b838..d5b500a2fa802 100644 --- a/aio/yarn.lock +++ b/aio/yarn.lock @@ -3316,6 +3316,12 @@ karma-cli@^1.0.1: dependencies: resolve "^1.1.6" +karma-jasmine-html-reporter@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-0.2.2.tgz#48a8e5ef18807617ee2b5e33c1194c35b439524c" + dependencies: + karma-jasmine "^1.0.2" + karma-jasmine@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.0.tgz#22e4c06bf9a182e5294d1f705e3733811b810acf"