Skip to content

test: improve test-tls-set-encoding.js #57900

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

Closed

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Apr 16, 2025

There is almost no place in node.js test suite that validates the amount of time secureConnect event is emitted. Let's change that.

@anonrig anonrig requested a review from jasnell April 16, 2025 19:21
@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 Apr 16, 2025
Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

See https://github.com/nodejs/node/tree/cb5f671a34da32e3c2d70d7f3e7f869cda6b806b/test/common#mustcallfn-exact

client.on('secureConnect', common.mustCall(() => {
  console.log('client: on secureConnect');
}));

already verifies that the event is emitted exactly once.

@anonrig anonrig closed this Apr 16, 2025
@anonrig
Copy link
Member Author

anonrig commented Apr 16, 2025

Ah nice. Thanks @lpinca

Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.25%. Comparing base (795dd8e) to head (636493c).
Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57900      +/-   ##
==========================================
+ Coverage   90.24%   90.25%   +0.01%     
==========================================
  Files         630      630              
  Lines      185470   185781     +311     
  Branches    36375    36421      +46     
==========================================
+ Hits       167371   167675     +304     
- Misses      10993    10999       +6     
- Partials     7106     7107       +1     

see 53 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants