Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Bug 1445352 - Add code coverage for .jsx files #4866

Merged
merged 3 commits into from
Apr 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions karma.mc.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,36 @@ module.exports = function(config) {
// This will make karma fail if coverage reporting is less than the minimums here
thresholds: !isTDD && {
global: {
statements: 93,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok. Our average went down but it shouldn't affect our test quality since adding more code to .jsm files which had 100% coverage will decrease this average and will catch it.
We can slowly increase these numbers as we add more tests to .jsx files.

lines: 93.1,
functions: 89.7,
branches: 87.8,
},
each: {
statements: 100,
lines: 100,
functions: 100,
branches: 90,
branches: 66,
overrides: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is perfect.

"content-src/components/DiscoveryStreamComponents/**/*.jsx": {
statements: 0,
lines: 0,
functions: 0,
branches: 0,
},
"content-src/asrouter/**/*.jsx": {
statements: 57,
lines: 58,
functions: 60,
branches: 50,
},
"content-src/components/**/*.jsx": {
statements: 0,
lines: 0,
functions: 0,
branches: 0,
},
},
},
},
},
Expand Down Expand Up @@ -115,7 +141,7 @@ module.exports = function(config) {
},
{
enforce: "post",
test: /\.jsm?$/,
test: /\.js[mx]?$/,
loader: "istanbul-instrumenter-loader",
options: {esModules: true},
include: [
Expand Down