Code coverage for unit tests
This commit is contained in:
Родитель
d68e2b553c
Коммит
d5a1189fdc
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
[
|
||||
"istanbul",
|
||||
{
|
||||
"exclude": [
|
||||
"test/**/*.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
dist/*
|
||||
node_modules/
|
||||
.env
|
||||
test/coverage
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-env node */
|
||||
|
||||
const reporters = ["mocha", "coverage"];
|
||||
const reporters = ["mocha", "istanbul"];
|
||||
if (process.env.COVERALLS_REPO_TOKEN) {
|
||||
reporters.push("coveralls");
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ module.exports = function(config) {
|
|||
],
|
||||
frameworks: ["mocha", "chai"],
|
||||
reporters,
|
||||
coverageReporter: {
|
||||
istanbulReporter: {
|
||||
dir: "test/coverage",
|
||||
reporters: [
|
||||
{
|
||||
|
@ -25,13 +25,10 @@ module.exports = function(config) {
|
|||
},
|
||||
{
|
||||
type: "html",
|
||||
subdir(browser) {
|
||||
// normalization process to keep a consistent browser name
|
||||
// across different OS
|
||||
return browser.toLowerCase().split(/[ /-]/)[0];
|
||||
},
|
||||
},
|
||||
{ type: "text-summary" },
|
||||
{
|
||||
type: "text-summary",
|
||||
},
|
||||
],
|
||||
},
|
||||
files: [
|
||||
|
@ -40,11 +37,12 @@ module.exports = function(config) {
|
|||
"src/feature.js",
|
||||
"test/unit/*.spec.js",
|
||||
],
|
||||
// preprocessors: { "src/feature.js": ["coverage"] },
|
||||
preprocessors: { "src/feature.js": ["babel"] },
|
||||
plugins: [
|
||||
"karma-babel-preprocessor",
|
||||
"karma-chai",
|
||||
"karma-coveralls",
|
||||
"karma-coverage",
|
||||
"karma-istanbuljs-reporter",
|
||||
"karma-firefox-launcher",
|
||||
"karma-mocha",
|
||||
"karma-mocha-reporter",
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -10,6 +10,9 @@
|
|||
"shield-studies-addon-utils": "github:mozilla/shield-studies-addon-utils#develop"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-plugin-istanbul": "^4.1.6",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"chai": "^4.1.2",
|
||||
"doctoc": "^1.3.0",
|
||||
"eslint": "^4.7.2",
|
||||
|
@ -26,10 +29,12 @@
|
|||
"istanbul": "^1.1.0-alpha.1",
|
||||
"jshint": "^2.9.5",
|
||||
"karma": "^1.7.1",
|
||||
"karma-babel-preprocessor": "^7.0.0",
|
||||
"karma-chai": "^0.1.0",
|
||||
"karma-coverage": "^1.1.2",
|
||||
"karma-coveralls": "^1.1.2",
|
||||
"karma-firefox-launcher": "^1.0.1",
|
||||
"karma-istanbuljs-reporter": "^0.2.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-mocha-reporter": "^2.2.4",
|
||||
"minimist": "^1.2.0",
|
||||
|
|
Загрузка…
Ссылка в новой задаче