test(common): increase test coverage
See original GitHub issueDescription
As a community member of Cactus I want to feel good about using software that has good test coverage so that I can sleep a little bit better (not much because severe bugs can still lurk in codebases with 100% test coverage, but nevertheless…)
Currently if you run the test command for the common package (see below) then you get a coverage report is is mostly in the red. The idea for this issue is to turn that green.
Execute the tests of the common package
npx tap --jobs=1 --timeout=60 "packages/cactus-common/src/test/typescript/{unit,integration}/"
The report at the end of the test execution:
Suites: 5 passed, 5 of 5 completed
Asserts: 47 passed, of 47
Time: 10s
--------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
--------------------------|----------|----------|----------|----------|-------------------|
All files | 82.51 | 67.61 | 50 | 82.35 | |
main/typescript | 86.01 | 72.88 | 52.94 | 86.15 | |
bools.ts | 50 | 0 | 0 | 50 | 13 |
checks.ts | 40 | 0 | 0 | 40 | 16,17,18 |
coded-error.ts | 20 | 0 | 0 | 25 | 7,8,12 |
js-object-signer.ts | 96.77 | 91.67 | 100 | 96.77 | 34 |
key-converter.ts | 100 | 96.15 | 100 | 100 | 83 |
objects.ts | 62.5 | 77.78 | 50 | 66.67 | 57,58,59,60,63 |
public-api.ts | 100 | 100 | 36.36 | 100 | |
secp256k1-keys.ts | 100 | 100 | 100 | 100 | |
strings.ts | 28.57 | 0 | 0 | 28.57 | 9,13,17,18,19 |
main/typescript/logging | 69.7 | 41.67 | 42.86 | 69.7 | |
logger-provider.ts | 71.43 | 42.86 | 33.33 | 71.43 | 26,27,28,29 |
logger.ts | 68.42 | 40 | 45.45 | 68.42 | 46,50,54,58,61,67 |
test/typescript/fixtures | 71.43 | 100 | 50 | 71.43 | |
dummy-classes.ts | 71.43 | 100 | 50 | 71.43 | 11,24 |
--------------------------|----------|----------|----------|----------|-------------------|
Acceptance Criteria
- The first line (
All files
) is all green meaning that it’s above threshold (I think the limit for green is 85% but not a 100% sure on that) - Tests added use the
tape
library (nottap
) - Tests added follow the existing conventions
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (20 by maintainers)
Top Results From Across the Web
4 Steps to Improve Your Test Coverage | SmartBear
What is Test Coverage? · #1 Create a Plan and Set a Goal · #2 Increase Code Coverage · #3 Enhance Test Automation...
Read more >How to increase Test Coverage for Mobile and Web Apps
1. Use Automation Tools and Frameworks ... Software test automation is no longer a hidden method for achieving faster coverage. Test automation ...
Read more >How to Achieve more Test Coverage in Less Time?
It is a practice to improve software quality. Test coverage helps the testers to improve the quality of test cases that covers the...
Read more >Test Coverage in Software Testing (Tips to Maximize Testing ...
Test coverage helps monitor the quality of testing, and assists testers to create tests that cover areas that are missing or not validated. ......
Read more >Test Coverage in Software Testing - Guru99
In software testing, test coverage measures the amount of testing performed ... Helps to create additional test cases to increase coverage ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gabrielsoaresm94 No problem at all. Thank you for the contribution! Looking forward to the PR!
@gabrielsoaresm94 Depends, have you addressed this? =>