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

Add Test Suite, Achieve 80% Coverage #41

Merged
merged 11 commits into from
Dec 5, 2024
Merged

Add Test Suite, Achieve 80% Coverage #41

merged 11 commits into from
Dec 5, 2024

Conversation

ProfMoo
Copy link
Contributor

@ProfMoo ProfMoo commented Dec 4, 2024

Description Of Change

This PR adds a testing suite to this repository, achieving 80%+ test coverage of all relevant client files.

While working on the test suite, I ran across an old method on the client performWorkflowStep which was broken. As far as we can tell, no one uses this method and it doens't fit into the API surface of our Staking API anymore. So I've gone ahead and removed it. This makes this PR a breaking change.

I attempted to modify as little actual client code as possible while making these changes, focusing only on the testing and the appropriate coverage. Slight alterations were made, where necessary, to achieve maximal coverage (ex: exporting a method).

As you can see in the image attached in a comment, we've achieved 80%+ on statements and lines. We can still improve coverage for branches and funcs. But considering we started at 0 across the board, this is a huge improvement. The coverage image I posted can be regenerated via npm run coverage.

Testing Procedure

Added dozens of tests and achieved 80%+ test coverage :)

@cb-heimdall
Copy link

cb-heimdall commented Dec 4, 2024

✅ Heimdall Review Status

Requirement Status More Info
Reviews 2/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@ProfMoo
Copy link
Contributor Author

ProfMoo commented Dec 4, 2024

80%+ test coverage on statements and lines! You can see the summary on the top left of the image.

Screenshot 2024-12-04 at 4 42 29 PM

@@ -17,8 +17,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
Copy link
Contributor Author

@ProfMoo ProfMoo Dec 4, 2024

Choose a reason for hiding this comment

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

Needed to bump this so that I can use the most recent versions of chai. I was running into some ESModule/Common tsconfig.json issues without it.

If this is undesired, we can try to revert and look deeper into why I was running into interop issues. Can get tricky 😬.

@ProfMoo ProfMoo merged commit a96c684 into main Dec 5, 2024
5 checks passed
@ProfMoo ProfMoo deleted the fix/add-testing branch December 5, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants