Testing uses Jest:
npm run test — run all testsnpm run coverage — generate coverage statsTested areas include:
Current coverage is at (console output sample):
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 81.57 | 100 | 100 |
logger | 100 | 100 | 100 | 100 |
logs.ts | 100 | 100 | 100 | 100 |
services | 100 | 80.55 | 100 | 100 |
createEdge.ts | 100 | 75 | 100 | 100 | 23-24
createVertex.ts | 100 | 80 | 100 | 100 | 19
deleteEdge.ts | 100 | 100 | 100 | 100 |
deleteVertex.ts | 100 | 100 | 100 | 100 |
getEdge.ts | 100 | 100 | 100 | 100 |
getVertex.ts | 100 | 100 | 100 | 100 |
ingestService.ts | 100 | 73.33 | 100 | 100 | 13,24,29-30
updateEdge.ts | 100 | 100 | 100 | 100 |
updateVertex.ts | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------
Test Suites: 9 passed, 9 total
Tests: 31 passed, 31 total
Snapshots: 0 total
Time: 6.248 s
Ran all test suites.
As a note, only the services have tests written for them. I consider testing the controller to be redundant.