Skip to content

Commit

Permalink
[Storage] Fixing code coverage for the browser tests (#6666)
Browse files Browse the repository at this point in the history
* fix code coverage in the browsers

* keep only the json reporter in coverageReporter

* remove .only

* "text-summary": null - for console-logging the summary after the test run

* code coverage for storage-blob

* code coverage for storage-file-datalake

* code coverage for storage-file-share
  • Loading branch information
HarshaNalluru authored Dec 28, 2019
1 parent e38b643 commit 2d5f236
Show file tree
Hide file tree
Showing 9 changed files with 470 additions and 135 deletions.
497 changes: 414 additions & 83 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions sdk/storage/storage-blob/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(config) {
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-remap-coverage",
"karma-remap-istanbul",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor"
Expand Down Expand Up @@ -55,20 +55,21 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "remap-coverage", "junit", "json-to-file"],
reporters: ["mocha", "coverage", "junit", "json-to-file", "karma-remap-istanbul"],

coverageReporter: { type: "in-memory" },

// Coverage report settings
remapCoverageReporter: {
"text-summary": null, // to show summary in console
html: "./coverage-browser",
cobertura: "./coverage-browser/cobertura-coverage.xml"
coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [{ type: "json", subdir: ".", file: "coverage.json" }]
},

// Exclude coverage calculation for following files
remapOptions: {
exclude: /node_modules|test/g
remapIstanbulReporter: {
src: "coverage-browser/coverage.json",
reports: {
lcovonly: "coverage-browser/lcov.info",
html: "coverage-browser/html/report",
"text-summary": null
}
},

junitReporter: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-remap-coverage": "^0.1.5",
"karma-remap-istanbul": "^0.6.0",
"mocha": "^6.2.2",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi": "^1.1.3",
Expand Down
25 changes: 13 additions & 12 deletions sdk/storage/storage-file-datalake/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(config) {
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-remap-coverage",
"karma-remap-istanbul",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor"
Expand Down Expand Up @@ -55,20 +55,21 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "remap-coverage", "junit", "json-to-file"],
reporters: ["mocha", "coverage", "junit", "json-to-file", "karma-remap-istanbul"],

coverageReporter: { type: "in-memory" },

// Coverage report settings
remapCoverageReporter: {
"text-summary": null, // to show summary in console
html: "./coverage-browser",
cobertura: "./coverage-browser/cobertura-coverage.xml"
coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [{ type: "json", subdir: ".", file: "coverage.json" }]
},

// Exclude coverage calculation for following files
remapOptions: {
exclude: /node_modules|test/g
remapIstanbulReporter: {
src: "coverage-browser/coverage.json",
reports: {
lcovonly: "coverage-browser/lcov.info",
html: "coverage-browser/html/report",
"text-summary": null
}
},

junitReporter: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-datalake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-remap-coverage": "^0.1.5",
"karma-remap-istanbul": "^0.6.0",
"mocha": "^6.2.2",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi": "^1.1.3",
Expand Down
25 changes: 13 additions & 12 deletions sdk/storage/storage-file-share/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(config) {
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-remap-coverage",
"karma-remap-istanbul",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor"
Expand Down Expand Up @@ -55,20 +55,21 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "remap-coverage", "junit", "json-to-file"],
reporters: ["mocha", "coverage", "junit", "json-to-file", "karma-remap-istanbul"],

coverageReporter: { type: "in-memory" },

// Coverage report settings
remapCoverageReporter: {
"text-summary": null, // to show summary in console
html: "./coverage-browser",
cobertura: "./coverage-browser/cobertura-coverage.xml"
coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [{ type: "json", subdir: ".", file: "coverage.json" }]
},

// Exclude coverage calculation for following files
remapOptions: {
exclude: /node_modules|test/g
remapIstanbulReporter: {
src: "coverage-browser/coverage.json",
reports: {
lcovonly: "coverage-browser/lcov.info",
html: "coverage-browser/html/report",
"text-summary": null
}
},

junitReporter: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-share/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-remap-coverage": "^0.1.5",
"karma-remap-istanbul": "^0.6.0",
"mocha": "^6.2.2",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi": "^1.1.3",
Expand Down
25 changes: 13 additions & 12 deletions sdk/storage/storage-queue/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(config) {
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-remap-coverage",
"karma-remap-istanbul",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor"
Expand Down Expand Up @@ -55,20 +55,21 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "remap-coverage", "junit", "json-to-file"],
reporters: ["mocha", "coverage", "junit", "json-to-file", "karma-remap-istanbul"],

coverageReporter: { type: "in-memory" },

// Coverage report settings
remapCoverageReporter: {
"text-summary": null, // to show summary in console
html: "./coverage-browser",
cobertura: "./coverage-browser/cobertura-coverage.xml"
coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [{ type: "json", subdir: ".", file: "coverage.json" }]
},

// Exclude coverage calculation for following files
remapOptions: {
exclude: /node_modules|test/g
remapIstanbulReporter: {
src: "coverage-browser/coverage.json",
reports: {
lcovonly: "coverage-browser/lcov.info",
html: "coverage-browser/html/report",
"text-summary": null
}
},

junitReporter: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-queue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-remap-coverage": "^0.1.5",
"karma-remap-istanbul": "^0.6.0",
"mocha": "^6.2.2",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi": "^1.1.3",
Expand Down

0 comments on commit 2d5f236

Please sign in to comment.