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

Increase code coverage (even if just by a little bit) #136

Closed
Tracked by #806
thehenrytsai opened this issue Nov 4, 2022 · 12 comments · Fixed by #815 or #818
Closed
Tracked by #806

Increase code coverage (even if just by a little bit) #136

thehenrytsai opened this issue Nov 4, 2022 · 12 comments · Fixed by #815 or #818
Assignees
Labels
good first issue Good for newcomers hacktoberfest For the hacking month of October testing related to new or existing tests

Comments

@thehenrytsai
Copy link
Contributor

thehenrytsai commented Nov 4, 2022

Background:

The code coverage goal is 100% for this repo, so any PR adding any test to increase the overall code coverage would be super useful!

Task Details:

To know what code hasn't been covered:

  1. Run npm run test:node
  2. Ignore the code coverage summary at the end of the run, there is a better way:
  3. Use MacOS Finder or Windows Explorer to open the coverage/index.html page, it will show you precisely what line of code is not covered

Files that can be ignored as they will likely be undergoing drastic changes:

  • permissions-request.ts

Picking Up This Issue:

  • If you'd like to work on this, please comment "picking this up" below, and I'll assign the issue to you

Questions:

Resources:

  • Creating a Pull Request: If you're new to GitHub and unsure how to create a pull request, follow this step-by-step guide.

Remember, communication is key! If you have any questions or face any challenges, we're here to help so please don't hesitate to reach out.

Good Luck! 🍁

@thehenrytsai thehenrytsai added good first issue Good for newcomers testing related to new or existing tests labels Nov 4, 2022
@alexlemons
Copy link
Contributor

PR to test utils/object/removeUndefinedProperties: 154

@EbonyLouis EbonyLouis added the hacktoberfest For the hacking month of October label Sep 26, 2023
@tux7P
Copy link

tux7P commented Sep 27, 2023

picking this up

@EbonyLouis
Copy link
Contributor

@tux7P Yay! I'll assign it to you now.

I'd also like to note that Hacktoberfest officially kicks off on October 1st. Contributions made before the event may not be eligible for the challenge. However, feel free to start working on it, but I'd recommend holding off on submitting your PR until the event begins.

to be eligible for Hacktoberfest's official prizes make sure you're registered, registration is now open. Reach out if you need any help 🥳

Good Luck 🍁

@EbonyLouis
Copy link
Contributor

More than one person can work on this issue, feel free to comment "picking this up" if it interest you! 🍁

@shobitb
Copy link
Contributor

shobitb commented Oct 10, 2023

@EbonyLouis, picking this up!

shobitb added a commit to shobitb/dwn-sdk-js that referenced this issue Oct 16, 2023
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 |    91.2 |    88.23 |   66.66 |    91.2 |
```
@EbonyLouis
Copy link
Contributor

Heyy @tux7P how are things going with this issue? Is this something you still want to work on?

shobitb added a commit to shobitb/dwn-sdk-js that referenced this issue Oct 16, 2023
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 |
```
shobitb added a commit to shobitb/dwn-sdk-js that referenced this issue Oct 16, 2023
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 |
```
thehenrytsai pushed a commit that referenced this issue Oct 17, 2023
* Add tests for error cases in did-resolver.spec.ts

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 #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 |    91.2 |    88.23 |   66.66 |    91.2 |
```

* Add tests for error cases in did-resolver.spec.ts

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 #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 |
```

* Add tests for error cases in did-resolver.spec.ts

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 #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 |
```

* Arrange new Did related error codes alphabetically

* Use a different code for DidNotString
@Tushar98644
Copy link

@EbonyLouis picking this up !

@ANIRUDH-333
Copy link
Contributor

picking this up

@ANIRUDH-333
Copy link
Contributor

.take

Copy link

github-actions bot commented Oct 3, 2024

The issue you are trying to assign to yourself is already assigned.

@ANIRUDH-333
Copy link
Contributor

Can I still pick this up? @EbonyLouis

@EbonyLouis
Copy link
Contributor

@ANIRUDH-333, yes! I just assigned it to you thank you for contributing ✨

LiranCohen pushed a commit that referenced this issue Oct 8, 2024
Resolves #136 
Completely covers the `ed25519.ts` file with 100% coverage.

| File Name          | Statements | Branches | Functions | Lines  |
|--------------------|------------|----------|-----------|--------|
| **Before:**        |            |          |           |        |
| All files          |   99.05    |   97.55  |   96.04   |  99.05 |
| ed25519.ts         |   93.1     |   88.88  |   83.33   |  93.1  |
| **After:**         |            |          |           |        |
| All files          |   99.09    |   97.6   |   96.25   |  99.09 |
| ed25519.ts         |   100      |   100    |   100     |  100   |
thehenrytsai pushed a commit that referenced this issue Oct 9, 2024
Resolves #136 
Improves the test coverage in `blockstore-mock.ts` from 51.25% to 85%

| File Name            | Statements | Branches | Functions | Lines  |
|----------------------|------------|----------|-----------|--------|
| **Before:**          |            |          |           |        |
| All files            |   99.05    |   97.55  |   96.04   |  99.05 |
| blockstore-mock.ts   |   51.25    |   100    |   8.33    |  51.25 |
| **After:**           |            |          |           |        |
| All files            |   99.29    |   97.57  |   97.7    |  99.29 |
| blockstore-mock.ts   |   85       |   100    |   75      |  85    |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest For the hacking month of October testing related to new or existing tests
Projects
None yet
7 participants