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

✅ Better mock/spy cleaning #4875

Merged
merged 2 commits into from
Apr 7, 2024
Merged

✅ Better mock/spy cleaning #4875

merged 2 commits into from
Apr 7, 2024

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Apr 7, 2024

Whenever running tests playing with mocks or spies, we have to make sure to properly clean everything. But over cleaning is as bad as no cleaning, more precisely, from a CI point of view, over cleaning tend to make tests slower.

This PR introduce a shared helper responsible to clean anything related to spies. It has to be added on case by case basis to clean describe-blocks using spies between every it and after the block, so that other blocks don't get broken by a previously running describe-block.

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

Sorry, something went wrong.

Copy link

codesandbox-ci bot commented Apr 7, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e36832e:

Sandbox Source
@fast-check/examples Configuration

Copy link
Contributor

github-actions bot commented Apr 7, 2024

👋 A preview of the new documentation is available at: http://6612ac21a1c26ac30ea2308c--dubzzz-fast-check.netlify.app

@dubzzz dubzzz enabled auto-merge (squash) April 7, 2024 14:23
Copy link

codecov bot commented Apr 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.88%. Comparing base (b32afae) to head (e36832e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4875   +/-   ##
=======================================
  Coverage   96.88%   96.88%           
=======================================
  Files         210      210           
  Lines       16117    16117           
  Branches     2619     2621    +2     
=======================================
  Hits        15615    15615           
  Misses        502      502           
Flag Coverage Δ
unit-tests 96.88% <ø> (ø)
unit-tests-18.x-Linux 96.88% <ø> (ø)
unit-tests-20.x-Linux 96.88% <ø> (ø)
unit-tests-latest-Linux 96.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@dubzzz dubzzz merged commit 8973a33 into main Apr 7, 2024
53 checks passed
@dubzzz dubzzz deleted the better-cleaning branch April 7, 2024 14:26
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