Skip to content

Commit

Permalink
chore(nyc coverage): fix coverage fail on async/await
Browse files Browse the repository at this point in the history
- nyc fails to cover async await function, to correct this
- install babel-plugin-istanbul
- add it as a test environment requirement in .babelrc
-
  • Loading branch information
chidimo committed May 22, 2019
1 parent 0a06008 commit 72cedc9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/transform-runtime"]
"plugins": ["@babel/transform-runtime"],
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@babel/runtime": "^7.4.4",
"@sendgrid/mail": "^6.4.0",
"aws-sdk": "^2.458.0",
"babel-plugin-istanbul": "^5.1.4",
"bcrypt": "^3.0.6",
"cookie-parser": "~1.4.3",
"cors": "^2.8.5",
Expand All @@ -56,5 +57,9 @@
"nyc": "^14.1.1",
"should": "^13.2.3",
"supertest": "^4.0.2"
},
"nyc": {
"sourceMap": false,
"instrument": false
}
}
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,15 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==

babel-plugin-istanbul@^5.1.4:
version "5.1.4"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba"
integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==
dependencies:
find-up "^3.0.0"
istanbul-lib-instrument "^3.3.0"
test-exclude "^5.2.3"

balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
Expand Down

0 comments on commit 72cedc9

Please sign in to comment.