node icon indicating copy to clipboard operation
node copied to clipboard

Expose `createErrDiff` for diffing objects

Open JMTK opened this issue 3 months ago • 0 comments

What is the problem this feature will solve?

I like the general format of the deepStrictEqual diff comparisons, but it would be nice to get this functionality "natively" to print a diff instead of forcing it to error to see a diff.

What is the feature you are proposing to solve the problem?

Expose createErrDiff from assert https://github.com/nodejs/node/blob/544cfc5ef151bca8d625fbccc581200a77b00bc0/lib/internal/assert/assertion_error.js#L79

What alternatives have you considered?

Userland diff tool, but if the code is already there it would be nice to expose it

JMTK avatar Feb 13 '24 00:02 JMTK