-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexander “weej” Jones <[email protected]>
…ease the linter...
await once(et, 'foo'); | ||
await once(et, 'foo'); | ||
})().then(common.mustCall()); | ||
test('should resolve `once` twice', (t, done) => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
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 |
hey @alexweej, there's a lint issue: |
Signed-off-by: Alexander “weej” Jones [email protected]