Skip to content

assert: fix Assert instance diff option ignored in throws/rejects#63840

Open
Anshikakalpana wants to merge 1 commit into
nodejs:mainfrom
Anshikakalpana:fix-assert-diff-context
Open

assert: fix Assert instance diff option ignored in throws/rejects#63840
Anshikakalpana wants to merge 1 commit into
nodejs:mainfrom
Anshikakalpana:fix-assert-diff-context

Conversation

@Anshikakalpana

Copy link
Copy Markdown
Contributor

When using new Assert({ diff: 'full' }), the diff option was silently ignored in throws, rejects, doesNotThrow, and doesNotReject.

expectsError and expectsNoError were not called with .call(this, ...), so the instance this context was never passed through, causing the diff option to always fall back to 'simple'.

Fix by passing this context using .call(this, ...) in all four methods.

A regression test has been added to test/parallel/test-assert-class.js.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Jun 10, 2026
@Anshikakalpana Anshikakalpana force-pushed the fix-assert-diff-context branch 3 times, most recently from 89a7751 to f533b10 Compare June 10, 2026 20:52
Signed-off-by: anshikakalpana <anshikajain196872@gmail.com>
@Anshikakalpana Anshikakalpana force-pushed the fix-assert-diff-context branch from f533b10 to 68fe8bd Compare June 10, 2026 21:01
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. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants