Skip to content

Commit 46d315f

Browse files
authored
chore(#864): change instanbul to nyc for coverage on all projects (#191)
chore(#864): change instanbul to nyc for coverage on all projects - Added .nycrc.yml with standard Mojaloop code-coverage milestones - Updated test:coverage & test:coverage-check script in package.json - removed unnecessary configs defined in the .nycrc.yml - Added Todo in README.md with note about future code-coverage improvements - Minor bump to patch level to reflect dependency updates - Fixed audit-resolve issues: ```text -------------------------------------------------- tar needs your attention. [ high ] Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization vulnerable versions <3.2.2 || >=4.0.0 <4.4.14 || >=5.0.0 <5.0.6 || >=6.0.0 <6.1.1 found in: - dependencies: @mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar [ high ] Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning vulnerable versions <3.2.3 || >=4.0.0 <4.4.15 || >=5.0.0 <5.0.7 || >=6.0.0 <6.1.2 found in: - dependencies: @mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar ``` > Outcome: Fixed ```text -------------------------------------------------- yargs-parser needs your attention. [ low ] Prototype Pollution vulnerable versions <13.1.2 || >=14.0.0 <15.0.1 || >=16.0.0 <18.1.2 found in: - dependencies: @mojaloop/central-services-shared>widdershins>yargs>yargs-parser -------------------------------------------------- sanitize-html needs your attention. [ moderate ] Improper Input Validation vulnerable versions <2.3.1 found in: - dependencies: @mojaloop/central-services-shared>shins>sanitize-html [ moderate ] Improper Input Validation vulnerable versions <2.3.2 found in: - dependencies: @mojaloop/central-services-shared>shins>sanitize-html ``` > Outcome: Ignored for a week > Impact: Minimal as this is used to render documentation end-point
1 parent 209bc84 commit 46d315f

5 files changed

Lines changed: 1440 additions & 1166 deletions

File tree

‎.nycrc.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
temp-directory: "./.nyc_output"
2+
check-coverage: true
3+
per-file: true
4+
lines: 90
5+
statements: 90
6+
functions: 90
7+
# branches: 90 ## TODO: This should be un-commented to 90 once code-coverage is improved!
8+
all: true
9+
include: [
10+
"src/**/*.js"
11+
]
12+
reporter: [
13+
"lcov"
14+
]
15+
exclude: [
16+
"src/setup.js", # Ignoring this until there is a reason to test this file. Currently just exports the library functions.
17+
"src/lib/kafka/index.js", # Ignoring this until there is a reason to test this file. Currently just exports the library functions.
18+
"**/node_modules/**"
19+
]

‎README.md‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ Email Notifier is a stand-alone email service that consumes messages from kafka
88
The central-event-processor repo is available [here](https://github.com/mojaloop/central-event-processor/tree/master)
99
The email-notifier flow is available [here](https://github.com/mojaloop/central-event-processor/tree/master#Notifierflowseparateservice)
1010

11-
## Contents:
11+
## Contents
1212

13-
- [Config](#config)
14-
- [Troubleshooting](#troubleshooting-npm-install-on-macos)
15-
- [Auditing Dependencies](#auditing-dependencies)
16-
- [Container Scans](#container-scans)
13+
- [email-notifier](#email-notifier)
14+
- [Contents](#contents)
15+
- [Todo](#todo)
16+
- [Config](#config)
17+
- [Troubleshooting `npm install` on MacOS](#troubleshooting-npm-install-on-macos)
18+
- [Auditing Dependencies](#auditing-dependencies)
19+
- [Container Scans](#container-scans)
1720

21+
## Todo
22+
23+
- Improve code-coverage to 90% across the board: [.nycrc.yml](./.nycrc.yml). Don't forget to un-comment out the branches code-coverage rule.
1824

1925
## Config
2026

‎audit-resolve.json‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,35 @@
7474
},
7575
"1500|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
7676
"decision": "ignore",
77-
"madeAt": 1623667801477,
78-
"expiresAt": 1624272585565
77+
"madeAt": 1629388382628,
78+
"expiresAt": 1629993162001
7979
},
8080
"1751|@mojaloop/central-services-shared>shins>chokidar>glob-parent": {
8181
"decision": "fix",
8282
"madeAt": 1623667798314
8383
},
8484
"1675|@mojaloop/central-services-shared>shins>sanitize-html": {
8585
"decision": "ignore",
86-
"madeAt": 1623667803515,
87-
"expiresAt": 1624272585565
86+
"madeAt": 1629388385750,
87+
"expiresAt": 1629993162001
8888
},
8989
"1676|@mojaloop/central-services-shared>shins>sanitize-html": {
9090
"decision": "ignore",
91-
"madeAt": 1623667803515,
92-
"expiresAt": 1624272585565
91+
"madeAt": 1629388385750,
92+
"expiresAt": 1629993162001
9393
},
9494
"1693|@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
9595
"decision": "ignore",
9696
"madeAt": 1623667805440,
9797
"expiresAt": 1624272585565
98+
},
99+
"1770|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
100+
"decision": "fix",
101+
"madeAt": 1629388377186
102+
},
103+
"1771|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
104+
"decision": "fix",
105+
"madeAt": 1629388377187
98106
}
99107
},
100108
"rules": {},

0 commit comments

Comments
 (0)