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: use test runner in eventtarget-once-twice test #55752

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

alexweej
Copy link

@alexweej alexweej commented Nov 6, 2024

Signed-off-by: Alexander “weej” Jones [email protected]

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Nov 6, 2024
@pmarchini pmarchini added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2024
await once(et, 'foo');
await once(et, 'foo');
})().then(common.mustCall());
test('should resolve `once` twice', (t, done) => {
Copy link
Member

Choose a reason for hiding this comment

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

This can be simplified as an asynchronous function, right? Calling "done" in the middle might lead to a race condition that generates extraneous asynchronous activity

Copy link
Author

Choose a reason for hiding this comment

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

That was my original idea but @tlhunter suggested we try with just done. Personally I'm 65/35 on doing it with async the way it currently is now. What do you both think?

Copy link
Author

Choose a reason for hiding this comment

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

(Now, after I updated the PR to use async (again), albeit slightly simpler)

Copy link
Member

Choose a reason for hiding this comment

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

I'm inclined on the async way, it's much cleaner, and there's IMO less of a chance for a race condition

@RedYetiDev RedYetiDev added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Nov 7, 2024
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.42%. Comparing base (1aa7135) to head (2178ded).
Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55752      +/-   ##
==========================================
+ Coverage   88.40%   88.42%   +0.01%     
==========================================
  Files         654      654              
  Lines      187747   187752       +5     
  Branches    36127    36129       +2     
==========================================
+ Hits       165972   166012      +40     
+ Misses      15009    14992      -17     
+ Partials     6766     6748      -18     

see 23 files with indirect coverage changes

@pmarchini
Copy link
Member

pmarchini commented Nov 8, 2024

hey @alexweej, there's a lint issue:
image
You can fix it running make lint-js-fix 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants