Skip to content

assert: allow printf-style messages as assertion error #58849

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BridgeAR
Copy link
Member

Also add functions as allowed message input.
This allows to have heavy message computation to become cheaper.

This is not yet finished, I just thought I could get some early feedback.
Tests are often not as performance sensitive, so it's not that crucial.
I do like the ergonomics of it as well though and I know I worked around
a test perf issue of this kind in Node.js before.

image

Also add functions as allowed message input.
This allows to have leavy message computation to become cheaper.
@BridgeAR BridgeAR added the semver-minor PRs that contain new features and should be released in the next minor version. label Jun 26, 2025
@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run. labels Jun 26, 2025
@@ -165,7 +183,7 @@ assert.equal = function equal(actual, expected, message) {
* @param {string | Error} [message]
Copy link
Member

@avivkeller avivkeller Jun 27, 2025

Choose a reason for hiding this comment

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

This type needs to be updated

(I know it's not finished, but other than that, love it!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants