Skip to content

Commit e4849aa

Browse files
committed
chore(#864): change instanbul to nyc for coverage on all projects (#231)
chore(#864): change instanbul to nyc for coverage on all projects - Added .nycrc.yml with commented out standard Mojaloop code-coverage rules - Added Todo in README.md with note about future tests, code-coverage & CI-CD improvements - Updated test:coverage & test:coverage-check script in package.json - removed unnecessary configs defined in the .nycrc.yml - Minor bump to patch level to reflect dependency updates - Fixed audit-resolve issues: ```text -------------------------------------------------- urijs needs your attention. [ moderate ] Hostname spoofing via backslashes in URL vulnerable versions <1.19.7 found in: - dependencies: @mojaloop/central-services-shared>widdershins>urijs -------------------------------------------------- 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 -------------------------------------------------- path-parse needs your attention. [ moderate ] Regular Expression Denial of Service in path-parse vulnerable versions <1.0.7 found in: - dependencies: @mojaloop/elastic-apm-node>read-pkg-up>read-pkg>normalize-package-data>resolve>path-parse - dependencies: @mojaloop/elastic-apm-node>require-in-the-middle>resolve>path-parse ``` > 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 f5a01a0 commit e4849aa

File tree

5 files changed

+1642
-305
lines changed

5 files changed

+1642
-305
lines changed

.nycrc.yml

+19
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

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
**EXPERIMENTAL** Event Stream Processor (ESP) for Event Stream (logs, audits, errors, trace, etc)
44

5+
## Todo
6+
7+
- Improve unit tests.
8+
- Improve code-coverage to 90% across the board: [.nycrc.yml](./.nycrc.yml).
9+
- Add NPM script `test` as a `pre-commit` in the package.json.
10+
- Update CI-CD to include unit and code-coverage checks.
11+
512
## 1. Pre-requisites
613

714
### 1.1 Elasticsearch

audit-resolve.json

+26-6
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@
175175
},
176176
"1500|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
177177
"decision": "ignore",
178-
"madeAt": 1625158172377,
179-
"expiresAt": 1625762958048
178+
"madeAt": 1629449959242,
179+
"expiresAt": 1630054673543
180180
},
181181
"1677|@mojaloop/elastic-apm-node>read-pkg-up>read-pkg>normalize-package-data>hosted-git-info": {
182182
"decision": "fix",
@@ -214,8 +214,8 @@
214214
},
215215
"1675|@mojaloop/central-services-shared>shins>sanitize-html": {
216216
"decision": "ignore",
217-
"madeAt": 1625158174063,
218-
"expiresAt": 1625762958048
217+
"madeAt": 1629449961945,
218+
"expiresAt": 1630054673543
219219
},
220220
"1676|@mojaloop/central-services-health>@mojaloop/central-services-shared>shins>sanitize-html": {
221221
"decision": "ignore",
@@ -224,8 +224,8 @@
224224
},
225225
"1676|@mojaloop/central-services-shared>shins>sanitize-html": {
226226
"decision": "ignore",
227-
"madeAt": 1625158174063,
228-
"expiresAt": 1625762958048
227+
"madeAt": 1629449961945,
228+
"expiresAt": 1630054673543
229229
},
230230
"1693|@mojaloop/central-services-health>@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
231231
"decision": "ignore",
@@ -236,6 +236,26 @@
236236
"decision": "ignore",
237237
"madeAt": 1620986565754,
238238
"expiresAt": 1621591332977
239+
},
240+
"1766|@mojaloop/central-services-shared>widdershins>urijs": {
241+
"decision": "fix",
242+
"madeAt": 1629449886923
243+
},
244+
"1770|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
245+
"decision": "fix",
246+
"madeAt": 1629449910757
247+
},
248+
"1771|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
249+
"decision": "fix",
250+
"madeAt": 1629449910757
251+
},
252+
"1773|@mojaloop/elastic-apm-node>read-pkg-up>read-pkg>normalize-package-data>resolve>path-parse": {
253+
"decision": "fix",
254+
"madeAt": 1629449953781
255+
},
256+
"1773|@mojaloop/elastic-apm-node>require-in-the-middle>resolve>path-parse": {
257+
"decision": "fix",
258+
"madeAt": 1629449953781
239259
}
240260
},
241261
"rules": {},

0 commit comments

Comments
 (0)