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

test: Add minimal test mock library #4898

Draft
wants to merge 2 commits into
base: philprime/manual-data-tracking
Choose a base branch
from

Conversation

philprime
Copy link
Contributor

@philprime philprime commented Feb 25, 2025

📜 Description

Adds minimal testing framework for mocking dependencies and assert function calling in unit testing. Heavily inspiried by jest.

💡 Motivation and Context

We want to add unit tests which tests files and logic in isolation, as sometimes spinning up the entire SDK can be cumbersome. Using subclasses and protocols we can inject mocked instances. The minimal framework allows creating readable assertion tests.

This has been a timeboxed experiment to evaluate the option of using this instead of a third-party mock SDK which can be bloated and bring in additional unwanted complexity.

🔮 Next steps

  • Add testing for framework
  • Add more documentation
  • Support more than 3 arguments

@philprime philprime self-assigned this Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 9.053%. Comparing base (013aa42) to head (5675758).

❗ There is a different number of reports uploaded between BASE (013aa42) and HEAD (5675758). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (013aa42) HEAD (5675758)
2 1
Additional details and impacted files

Impacted file tree graph

@@                         Coverage Diff                          @@
##           philprime/manual-data-tracking    #4898        +/-   ##
====================================================================
- Coverage                          92.290%   9.053%   -83.238%     
====================================================================
  Files                                 661      352       -309     
  Lines                               77747    25052     -52695     
  Branches                            28010       94     -27916     
====================================================================
- Hits                                71753     2268     -69485     
- Misses                               5901    22784     +16883     
+ Partials                               93        0        -93     

see 652 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 013aa42...5675758. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant