-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% tests coverage for web5/crypto
#215
Conversation
adam4leos
commented
Sep 12, 2023
@@ -863,7 +863,7 @@ export class Jose { | |||
const jose = multicodecToJoseMapping[lookupKey]; | |||
|
|||
if (jose === undefined) { | |||
throw new Error(`Unsupported Multicodec to JOSE conversion: '${options.name ?? options.code}'`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unreachable;
we can't hit this line with undefined code AND name, as undefined code would throw in getNameFromCode
with undefined name
Removed to reach 100% tests coverage, as it's not possible to cover unreachable edge case...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the clarification
Codecov Report
@@ Coverage Diff @@
## main #215 +/- ##
==========================================
+ Coverage 89.42% 90.78% +1.35%
==========================================
Files 64 67 +3
Lines 12399 12828 +429
Branches 1188 1268 +80
==========================================
+ Hits 11088 11646 +558
+ Misses 1291 1159 -132
- Partials 20 23 +3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -863,7 +863,7 @@ export class Jose { | |||
const jose = multicodecToJoseMapping[lookupKey]; | |||
|
|||
if (jose === undefined) { | |||
throw new Error(`Unsupported Multicodec to JOSE conversion: '${options.name ?? options.code}'`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the clarification
* jose file covered * remove unreachable condition
* jose file covered * remove unreachable condition