Commit 45e3d1b9 authored by Paul Lewis's avatar Paul Lewis Committed by Commit Bot

[DevTools] Updates Karma to report coverage

The Karma tests that run do not currently produce a coverage report.
This CL adds local coverage reporting with a view to start exposing the
reports at the CQ level eventually.

Change-Id: Id374ee34c911a5762ce37ad69799fe00bcf1c29d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1831760
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701116}
parent 4779afe9
......@@ -238,7 +238,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling devtools-node-modules
# and whatever else without interference from each other.
'devtools_node_modules_revision': '499e57bfea8a4f8e8373321f2c99632372553e56',
'devtools_node_modules_revision': '42d0028a8621347b04fa31462b33a32cd105d715',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libprotobuf-mutator
# and whatever else without interference from each other.
......
......@@ -19,8 +19,9 @@ npm-debug.log
package-lock.json
.vscode
/front_end/*/jsconfig.json
karma-coverage
# These are generated for build and would be put in the symlinked folder (thus this folder)
front_end/InspectorBackendCommands.js
front_end/SupportedCSSProperties.js
front_end/accessibility/ARIAProperties.js
\ No newline at end of file
front_end/accessibility/ARIAProperties.js
......@@ -13,15 +13,13 @@ module.exports = function(config) {
},{
pattern: 'tests/**/*.ts',
type: 'module'
}, {
pattern: 'tests/**/*.js',
type: 'module'
}],
reporters: ["dots"],
reporters: ["dots", "coverage-istanbul"],
preprocessors: {
'./tests/**/*.ts': ['karma-typescript']
'./tests/**/*.ts': ['karma-typescript'],
'./front_end/common/*.js': ['karma-coverage-istanbul-instrumenter']
},
browsers: ["ChromeHeadless"],
......@@ -55,9 +53,20 @@ module.exports = function(config) {
"karma-chrome-launcher",
"karma-mocha",
"karma-chai",
"karma-typescript"
"karma-typescript",
require('../../../../third_party/devtools-node-modules/third_party/node_modules/karma-coverage-istanbul-instrumenter'),
require('../../../../third_party/devtools-node-modules/third_party/node_modules/karma-coverage-istanbul-reporter')
],
coverageIstanbulInstrumenter: {
esModules: true
},
coverageIstanbulReporter: {
reports: ["text", "html"],
dir: "karma-coverage"
},
singleRun: true
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment