Skip to content

Changing assert to become a class#58253

Merged
nodejs-github-bot merged 16 commits intonodejs:mainfrom
miguelmarcondesf:assert-become-class
Aug 5, 2025
Merged

Changing assert to become a class#58253
nodejs-github-bot merged 16 commits intonodejs:mainfrom
miguelmarcondesf:assert-become-class

Conversation

@miguelmarcondesf
Copy link
Copy Markdown
Contributor

@miguelmarcondesf miguelmarcondesf commented May 9, 2025

Changing assert to become a class

This PR refactors assert from a method to a dedicated class. This change is motivated by the need for greater flexibility and configurability in assertion behavior.

By turning assert into a class, we will be able to pass options that customize its behavior, such as doing specific checks, how the stack trace will look like, etc.

Checklist

  • Refactor assert into a class structure (old-school pattern).
  • Add diff option to show the full diff in assertion errors.
  • Ensure backward compatibility with existing assert usages.
  • Add new unit tests to cover the class-based behavior.

cc @BridgeAR

Loading
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. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants