Skip to content
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

Merged
merged 2 commits into from
Sep 14, 2023
Merged

100% tests coverage for web5/crypto #215

merged 2 commits into from
Sep 14, 2023

Conversation

adam4leos
Copy link
Contributor

Screenshot 2023-09-12 at 3 57 46 PM

@@ -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}'`);
Copy link
Contributor Author

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...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the clarification

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #215 (b526312) into main (150b419) will increase coverage by 1.35%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

@@            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     
Components Coverage Δ
api 94.06% <ø> (-0.27%) ⬇️
common 95.00% <ø> (ø)
credentials 92.77% <ø> (∅)
crypto 100.00% <100.00%> (+5.12%) ⬆️
dids 92.16% <ø> (ø)
agent 87.80% <ø> (ø)
identity-agent 59.05% <ø> (ø)
proxy-agent 58.59% <ø> (ø)
user-agent 57.36% <ø> (ø)

@adam4leos adam4leos changed the title 100% tests coverage 100% tests coverage for web5/crypto Sep 13, 2023
Copy link
Contributor

@frankhinek frankhinek left a 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}'`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the clarification

@adam4leos adam4leos merged commit ff920f5 into main Sep 14, 2023
finn-block pushed a commit that referenced this pull request Sep 18, 2023
* jose file covered

* remove unreachable condition
@frankhinek frankhinek linked an issue Sep 26, 2023 that may be closed by this pull request
andorsk pushed a commit to modernfoundry/web5-js that referenced this pull request Sep 28, 2023
* jose file covered

* remove unreachable condition
@frankhinek frankhinek deleted the 100-percent-tests branch November 3, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase test coverage for @web5/crypto
2 participants