Skip to content

Commit

Permalink
chore: improve tests for lib-shared to 100 percent coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotot committed Sep 6, 2024
1 parent 3afa3c5 commit 89a5a93
Show file tree
Hide file tree
Showing 43 changed files with 2,637 additions and 181 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,19 @@
"outputCapture": "std",
"autoAttachChildProcesses": false
},
{
"name": "@org/lib-commons: test - coverage",
"runtimeArgs": ["run", "test:coverage", "--prefix", "packages/mern-sample-app/lib-commons"],
"presentation": { "group": "5" },
// Defaults below
"runtimeVersion": "21.7.0",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"console": "integratedTerminal",
"outputCapture": "std",
"autoAttachChildProcesses": false
},
{
"name": "@org/lib-commons: build",
"runtimeArgs": ["run", "build", "--prefix", "packages/mern-sample-app/lib-commons"],
Expand Down
1 change: 1 addition & 0 deletions coverage/.tmp/coverage-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"result":[{"scriptId":"290","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/test/random.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1182,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1182,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":207,"endOffset":344,"count":0}],"isBlockCoverage":false}]}]}
1 change: 1 addition & 0 deletions coverage/.tmp/coverage-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"result":[{"scriptId":"290","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/test/user.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":3088,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":3088,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":304,"endOffset":998,"count":0}],"isBlockCoverage":false}]}]}
1 change: 1 addition & 0 deletions coverage/.tmp/coverage-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"result":[{"scriptId":"290","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/test/random.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":3870,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":3870,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":476,"endOffset":1308,"count":0}],"isBlockCoverage":false}]},{"scriptId":"372","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/dist/lib/bottlejs/IocRegistry.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":11234,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":11234,"count":1}],"isBlockCoverage":true},{"functionName":"__classPrivateFieldGet","ranges":[{"startOffset":541,"endOffset":961,"count":0}],"isBlockCoverage":false},{"functionName":"IocRegistry","ranges":[{"startOffset":1132,"endOffset":1302,"count":1}],"isBlockCoverage":true},{"functionName":"inject","ranges":[{"startOffset":1307,"endOffset":1635,"count":0}],"isBlockCoverage":false},{"functionName":"iocStartup","ranges":[{"startOffset":1640,"endOffset":2525,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":2627,"endOffset":2654,"count":0}],"isBlockCoverage":false},{"functionName":"_IocRegistry_getSortedInjectionClasses","ranges":[{"startOffset":2739,"endOffset":3402,"count":0}],"isBlockCoverage":false},{"functionName":"_IocRegistry_getDependencySchema","ranges":[{"startOffset":3439,"endOffset":3746,"count":0}],"isBlockCoverage":false},{"functionName":"_IocRegistry_setupComponentNameMetadata","ranges":[{"startOffset":3790,"endOffset":4096,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":4236,"endOffset":4263,"count":0}],"isBlockCoverage":false}]},{"scriptId":"374","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/dist/lib/bottlejs/index.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1100,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1100,"count":1}],"isBlockCoverage":true}]},{"scriptId":"375","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/dist/lib/bottlejs/IocServiceDecoratorMetadataEntry.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":3148,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":3148,"count":1}],"isBlockCoverage":true},{"functionName":"for","ranges":[{"startOffset":544,"endOffset":630,"count":0}],"isBlockCoverage":false},{"functionName":"IocServiceDecoratorMetadataEntry","ranges":[{"startOffset":635,"endOffset":764,"count":0}],"isBlockCoverage":false},{"functionName":"setName","ranges":[{"startOffset":769,"endOffset":822,"count":0}],"isBlockCoverage":false},{"functionName":"addDependency","ranges":[{"startOffset":827,"endOffset":898,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1021,"endOffset":1069,"count":0}],"isBlockCoverage":false}]},{"scriptId":"376","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/dist/decorators/config/DecoratorMetadataEntry.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":4976,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":4976,"count":1}],"isBlockCoverage":true},{"functionName":"__classPrivateFieldSet","ranges":[{"startOffset":443,"endOffset":958,"count":0}],"isBlockCoverage":false},{"functionName":"__classPrivateFieldGet","ranges":[{"startOffset":1030,"endOffset":1450,"count":0}],"isBlockCoverage":false},{"functionName":"DecoratorMetadataEntry","ranges":[{"startOffset":1593,"endOffset":2133,"count":0}],"isBlockCoverage":false},{"functionName":"get value","ranges":[{"startOffset":2138,"endOffset":2705,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":2818,"endOffset":2856,"count":1}],"isBlockCoverage":true}]},{"scriptId":"377","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/app-node-express/dist/decorators/config/DecoratorMetadata.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":7800,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":7800,"count":1},{"startOffset":1678,"endOffset":1682,"count":0}],"isBlockCoverage":true},{"functionName":"__classPrivateFieldSet","ranges":[{"startOffset":255,"endOffset":770,"count":0}],"isBlockCoverage":false},{"functionName":"__classPrivateFieldGet","ranges":[{"startOffset":842,"endOffset":1262,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1548,"endOffset":1576,"count":0}],"isBlockCoverage":false},{"functionName":"for","ranges":[{"startOffset":1769,"endOffset":1834,"count":0}],"isBlockCoverage":false},{"functionName":"DecoratorMetadata","ranges":[{"startOffset":1839,"endOffset":2351,"count":0}],"isBlockCoverage":false},{"functionName":"hasKey","ranges":[{"startOffset":2356,"endOffset":2464,"count":0}],"isBlockCoverage":false},{"functionName":"getValue","ranges":[{"startOffset":2469,"endOffset":2577,"count":0}],"isBlockCoverage":false},{"functionName":"setValue","ranges":[{"startOffset":2582,"endOffset":2698,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":2806,"endOffset":2839,"count":0}],"isBlockCoverage":false},{"functionName":"_DecoratorMetadata_getMetadataRef","ranges":[{"startOffset":3016,"endOffset":3559,"count":0}],"isBlockCoverage":false}]}]}
1 change: 1 addition & 0 deletions coverage/.tmp/coverage-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"result":[{"scriptId":"290","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/test/getTypedError.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":3899,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":3899,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":410,"endOffset":1373,"count":0}],"isBlockCoverage":false}]},{"scriptId":"291","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/index.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1728,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1728,"count":1}],"isBlockCoverage":true}]},{"scriptId":"292","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/config/index.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1683,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1683,"count":1}],"isBlockCoverage":true}]},{"scriptId":"293","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/config/Zod.config.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1252,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1252,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":572,"endOffset":617,"count":27}],"isBlockCoverage":true}]},{"scriptId":"313","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/config/Entity.config.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":2487,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":2487,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":728,"endOffset":762,"count":0}],"isBlockCoverage":false},{"functionName":"Entity","ranges":[{"startOffset":766,"endOffset":935,"count":2}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":1030,"endOffset":1052,"count":2}],"isBlockCoverage":true}]},{"scriptId":"314","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/config/Types.config.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1906,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1906,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":441,"endOffset":461,"count":3}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":604,"endOffset":634,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":759,"endOffset":783,"count":1}],"isBlockCoverage":true}]},{"scriptId":"315","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/config/ResponseError.config.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":2618,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":2618,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":521,"endOffset":563,"count":0}],"isBlockCoverage":false},{"functionName":"getTypedError","ranges":[{"startOffset":567,"endOffset":940,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1042,"endOffset":1071,"count":0}],"isBlockCoverage":false}]},{"scriptId":"316","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/errors/index.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":790,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":790,"count":1}],"isBlockCoverage":true}]},{"scriptId":"317","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/errors/ResponseError.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":4213,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":4213,"count":1}],"isBlockCoverage":true},{"functionName":"__classPrivateFieldGet","ranges":[{"startOffset":358,"endOffset":778,"count":0}],"isBlockCoverage":false},{"functionName":"ErrorResponse","ranges":[{"startOffset":881,"endOffset":1269,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1373,"endOffset":1402,"count":0}],"isBlockCoverage":false},{"functionName":"_ErrorResponse_buildErrorLog","ranges":[{"startOffset":1479,"endOffset":1628,"count":0}],"isBlockCoverage":false}]},{"scriptId":"319","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/domain/index.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":995,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":995,"count":1}],"isBlockCoverage":true}]},{"scriptId":"320","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/domain/User.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":9192,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":9192,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":1173,"endOffset":1193,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1804,"endOffset":1843,"count":0}],"isBlockCoverage":false},{"functionName":"PageableResponseDto","ranges":[{"startOffset":1862,"endOffset":2111,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":2219,"endOffset":2254,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":2443,"endOffset":2482,"count":0}],"isBlockCoverage":false},{"functionName":"JsonQueryParam","ranges":[{"startOffset":2501,"endOffset":2696,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":2799,"endOffset":2829,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":3336,"endOffset":3369,"count":0}],"isBlockCoverage":false}]},{"scriptId":"321","url":"file:///home/bruno/Desktop/private/typescript/mern-monorepo-starter/packages/mern-sample-app/lib-commons/dist/src/domain/ErrorLog.js","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":2442,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":2442,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":987,"endOffset":1011,"count":0}],"isBlockCoverage":false}]}]}
Loading

0 comments on commit 89a5a93

Please sign in to comment.