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

refactor(*): introduce Expect class #39

Merged
merged 30 commits into from
Dec 7, 2023

Conversation

mrazauskas
Copy link
Member

@mrazauskas mrazauskas commented Dec 4, 2023

Introducing the Expect class which does the following:

  • allows moving matchers to their own classes;
  • validates arguments passed to the matchers;
  • if an error in encountered, emits "expect:error" event instead of all throwing an error;
  • provides this.typeChecker, instead of optional typeChecker currently provided by the Assertion class;
  • allows keeping only node related logic in the CollectService class.

Overall the structure and responsibilities will have a better shape.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (57e2704) 90.43% compared to head (28c0787) 90.86%.

Files Patch % Lines
src/expect/Expect.ts 94.08% 19 Missing ⚠️
src/runner/TestFileRunner.ts 50.00% 8 Missing ⚠️
src/expect/ToRaiseError.ts 94.85% 5 Missing and 2 partials ⚠️
src/expect/index.ts 0.00% 2 Missing ⚠️
src/tstyche.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   90.43%   90.86%   +0.43%     
==========================================
  Files          83       88       +5     
  Lines        5392     5529     +137     
  Branches      750      739      -11     
==========================================
+ Hits         4876     5024     +148     
+ Misses        513      501      -12     
- Partials        3        4       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mrazauskas mrazauskas changed the title refactor(checker): always report diagnostics instead of throwing errors refactor(*): introduce Expect class Dec 5, 2023
@mrazauskas mrazauskas merged commit 3223702 into main Dec 7, 2023
15 checks passed
@mrazauskas mrazauskas deleted the checker-emit-diagnostics-instead-of-throwing-errors branch December 7, 2023 08:55
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.

None yet

1 participant