Skip to content

Commit

Permalink
Add tests for error cases in did-resolver.spec.ts
Browse files Browse the repository at this point in the history
This commit adds new tests in did-resolver.spec.ts to cover some of the previously uncovered error-related branching paths.

This commit contributes partly to issue decentralized-identity#136.

Based on the output of `npm run test:node` before vs. after this commit, the `% Branch` is now increased by 9.66 percentage points, and the `% Stmt` and `% Lines` by 3.29 percentage points.

Before:
```
did-resolver.ts |   87.91 |    78.57 |   66.66 |   87.91
```

After:
```
did-resolver.ts |   92.34 |    94.11 |   66.66 |   92.34 |
```
  • Loading branch information
shobitb committed Oct 16, 2023
1 parent 36082ce commit 404d85f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/dwn-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export class DwnError extends Error {
export enum DwnErrorCode {
AuthenticateJwsMissing = 'AuthenticateJwsMissing',
AuthorizationUnknownAuthor = 'AuthorizationUnknownAuthor',
DidMethodNotSupported = 'DidMethodNotSupported',
DidNotValid = 'DidNotValid',
DidResolutionFailed = 'DidResolutionFailed',
GeneralJwsVerifierInvalidSignature = 'GeneralJwsVerifierInvalidSignature',
GrantAuthorizationGrantExpired = 'GrantAuthorizationGrantExpired',
GrantAuthorizationGrantMissing = 'GrantAuthorizationGrantMissing',
Expand Down

0 comments on commit 404d85f

Please sign in to comment.