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

style: add recommended mocha rules #1555

Merged
merged 1 commit into from
Nov 4, 2024
Merged

style: add recommended mocha rules #1555

merged 1 commit into from
Nov 4, 2024

Conversation

tpluscode
Copy link
Collaborator

No description provided.

@tpluscode tpluscode requested a review from giacomociti November 4, 2024 09:57
Copy link

changeset-bot bot commented Nov 4, 2024

⚠️ No Changeset found

Latest commit: a68d34e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.99%. Comparing base (35c8837) to head (a68d34e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1555      +/-   ##
==========================================
+ Coverage   73.96%   73.99%   +0.02%     
==========================================
  Files         222      222              
  Lines       15078    15093      +15     
  Branches      891      891              
==========================================
+ Hits        11153    11168      +15     
  Misses       3917     3917              
  Partials        8        8              

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

Copy link
Contributor

@giacomociti giacomociti left a comment

Choose a reason for hiding this comment

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

just curious why mocha recommends using function and not arrow functions. I guess it's to make available some test utilities (like timeout)?

@tpluscode
Copy link
Collaborator Author

tpluscode commented Nov 4, 2024

just curious why mocha recommends using function and not arrow functions. I guess it's to make available some test utilities (like timeout)?

Correct. I was surprised too. They say

Passing arrow functions (aka “lambdas”) to Mocha is discouraged. Lambdas lexically bind this and cannot access the Mocha context.

@tpluscode tpluscode merged commit e6a43dc into master Nov 4, 2024
23 checks passed
@tpluscode tpluscode deleted the lint-tests branch November 4, 2024 10:08
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.

2 participants