-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
util: expose diff function used by the assertion errors #57462
util: expose diff function used by the assertion errors #57462
Conversation
1905f00
to
480d3c7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57462 +/- ##
==========================================
+ Coverage 90.20% 90.23% +0.02%
==========================================
Files 629 630 +1
Lines 184948 184898 -50
Branches 36204 36217 +13
==========================================
- Hits 166837 166834 -3
+ Misses 11057 11019 -38
+ Partials 7054 7045 -9
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code change LGTM with one nit about the docs.
480d3c7
to
518712d
Compare
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (only one nit)
549a8b6
to
1a33a1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good!
I would still consider changing the output format to be the most performant one we can think of. I would likely change it to: [type, value]
, where type
would be one of -1, 0, 1
.
f4b06e7
to
fe1f36c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This is shaping up well!
Two small things, otherwise it's LGTM
fix: nodejs#51740
fe1f36c
to
dd09392
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
Landed in 6b42554 |
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 * (SEMVER-MINOR) improve partialDeepStrictEqual (Ruben Bridgewater) #57370 assert,util: * (SEMVER-MINOR) improve performance (Ruben Bridgewater) #57370 benchmark: * (SEMVER-MINOR) adjust assert runtimes (Ruben Bridgewater) #57370 * (SEMVER-MINOR) skip running some assert benchmarks by default (Ruben Bridgewater) #57370 * (SEMVER-MINOR) add assert partialDeepStrictEqual benchmark (Ruben Bridgewater) #57370 crypto: * (SEMVER-MINOR) add optional callback to crypto.diffieHellman (Filip Skokan) #57274 process: * (SEMVER-MINOR) add execve (Paolo Insogna) #56496 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 PR-URL: #57694
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 crypto: * (SEMVER-MINOR) add optional callback to `crypto.diffieHellman` (Filip Skokan) #57274 process: * (SEMVER-MINOR) add `execve` (Paolo Insogna) #56496 sqlite: * (SEMVER-MINOR) add `StatementSync.prototype.columns()` (Colin Ihrig) #57490 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 PR-URL: #57694 Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 crypto: * (SEMVER-MINOR) add optional callback to `crypto.diffieHellman` (Filip Skokan) #57274 process: * (SEMVER-MINOR) add `execve` (Paolo Insogna) #56496 sqlite: * (SEMVER-MINOR) add `StatementSync.prototype.columns()` (Colin Ihrig) #57490 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 PR-URL: #57694
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 crypto: * (SEMVER-MINOR) add optional callback to `crypto.diffieHellman` (Filip Skokan) #57274 process: * (SEMVER-MINOR) add `execve` (Paolo Insogna) #56496 sqlite: * (SEMVER-MINOR) add `StatementSync.prototype.columns()` (Colin Ihrig) #57490 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 PR-URL: #57694
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 crypto: * (SEMVER-MINOR) add optional callback to `crypto.diffieHellman` (Filip Skokan) #57274 process: * (SEMVER-MINOR) add `execve` (Paolo Insogna) #56496 sqlite: * (SEMVER-MINOR) add `StatementSync.prototype.columns()` (Colin Ihrig) #57490 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 PR-URL: #57694
fix: nodejs#51740 PR-URL: nodejs#57462 Fixes: nodejs#51740 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) nodejs#57370 crypto: * (SEMVER-MINOR) add optional callback to `crypto.diffieHellman` (Filip Skokan) nodejs#57274 process: * (SEMVER-MINOR) add `execve` (Paolo Insogna) nodejs#56496 sqlite: * (SEMVER-MINOR) add `StatementSync.prototype.columns()` (Colin Ihrig) nodejs#57490 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) nodejs#57462 PR-URL: nodejs#57694
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 * (SEMVER-MINOR) improve partialDeepStrictEqual (Ruben Bridgewater) #57370 assert,util: * (SEMVER-MINOR) improve performance (Ruben Bridgewater) #57370 benchmark: * (SEMVER-MINOR) adjust assert runtimes (Ruben Bridgewater) #57370 * (SEMVER-MINOR) skip running some assert benchmarks by default (Ruben Bridgewater) #57370 * (SEMVER-MINOR) add assert partialDeepStrictEqual benchmark (Ruben Bridgewater) #57370 cli: * (SEMVER-MINOR) allow --cpu-prof* in NODE_OPTIONS (Carlos Espa) #57018 crypto: * update root certificates to NSS 3.108 (Node.js GitHub Bot) #57381 * (SEMVER-MINOR) support --use-system-ca on Windows (Joyee Cheung) #56833 * (SEMVER-MINOR) added support for reading certificates from macOS system store (Tim Jacomb) #56599 deps: * update timezone to 2025a (Node.js GitHub Bot) #56876 * (SEMVER-MINOR) update ada to v3.0.1 (Yagiz Nizipli) #56452 deps,tools: * (SEMVER-MINOR) add zstd 1.5.6 (Jan Martin) #52100 dns: * (SEMVER-MINOR) add TLSA record query and parsing (Rithvik Vibhu) #52983 doc: * add @geeksilva97 to collaborators (Edy Silva) #57241 module: * (SEMVER-MINOR) use synchronous hooks for preparsing in import(cjs) (Joyee Cheung) #55698 * (SEMVER-MINOR) implement module.registerHooks() (Joyee Cheung) #55698 process: * (SEMVER-MINOR) add execve (Paolo Insogna) #56496 * (SEMVER-MINOR) add threadCpuUsage (Paolo Insogna) #56467 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 * (SEMVER-MINOR) allow returning `ArrayBufferView`s from user-defined functions (René) #56790 src: * set signal inspector io thread name (RafaelGSS) #56416 * set thread name for main thread and v8 worker (RafaelGSS) #56416 * set worker thread name using worker.name (RafaelGSS) #56416 * use a default thread name for inspector (RafaelGSS) #56416 test: * (SEMVER-MINOR) add WPT for URLPattern (Yagiz Nizipli) #56452 tls: * (SEMVER-MINOR) implement tls.getCACertificates() (Joyee Cheung) #57107 url: * (SEMVER-MINOR) add URLPattern implementation (Yagiz Nizipli) #56452 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 v8: * (SEMVER-MINOR) add v8.getCppHeapStatistics() method (Aditi) #57146 zlib: * (SEMVER-MINOR) add zstd support (Jan Martin) #52100 PR-URL: TODO
Notable changes: assert: * (SEMVER-MINOR) implement partial error comparison (Ruben Bridgewater) #57370 * (SEMVER-MINOR) improve partialDeepStrictEqual (Ruben Bridgewater) #57370 assert,util: * (SEMVER-MINOR) improve performance (Ruben Bridgewater) #57370 benchmark: * (SEMVER-MINOR) adjust assert runtimes (Ruben Bridgewater) #57370 * (SEMVER-MINOR) skip running some assert benchmarks by default (Ruben Bridgewater) #57370 * (SEMVER-MINOR) add assert partialDeepStrictEqual benchmark (Ruben Bridgewater) #57370 cli: * (SEMVER-MINOR) allow --cpu-prof* in NODE_OPTIONS (Carlos Espa) #57018 crypto: * update root certificates to NSS 3.108 (Node.js GitHub Bot) #57381 * (SEMVER-MINOR) support --use-system-ca on Windows (Joyee Cheung) #56833 * (SEMVER-MINOR) added support for reading certificates from macOS system store (Tim Jacomb) #56599 deps: * update timezone to 2025a (Node.js GitHub Bot) #56876 * (SEMVER-MINOR) update ada to v3.0.1 (Yagiz Nizipli) #56452 deps,tools: * (SEMVER-MINOR) add zstd 1.5.6 (Jan Martin) #52100 dns: * (SEMVER-MINOR) add TLSA record query and parsing (Rithvik Vibhu) #52983 doc: * add @geeksilva97 to collaborators (Edy Silva) #57241 module: * (SEMVER-MINOR) use synchronous hooks for preparsing in import(cjs) (Joyee Cheung) #55698 * (SEMVER-MINOR) implement module.registerHooks() (Joyee Cheung) #55698 process: * (SEMVER-MINOR) add execve (Paolo Insogna) #56496 * (SEMVER-MINOR) add threadCpuUsage (Paolo Insogna) #56467 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 * (SEMVER-MINOR) allow returning `ArrayBufferView`s from user-defined functions (René) #56790 src: * set signal inspector io thread name (RafaelGSS) #56416 * set thread name for main thread and v8 worker (RafaelGSS) #56416 * set worker thread name using worker.name (RafaelGSS) #56416 * use a default thread name for inspector (RafaelGSS) #56416 test: * (SEMVER-MINOR) add WPT for URLPattern (Yagiz Nizipli) #56452 tls: * (SEMVER-MINOR) implement tls.getCACertificates() (Joyee Cheung) #57107 url: * (SEMVER-MINOR) add URLPattern implementation (Yagiz Nizipli) #56452 util: * (SEMVER-MINOR) expose diff function used by the assertion errors (Giovanni Bucci) #57462 v8: * (SEMVER-MINOR) add v8.getCppHeapStatistics() method (Aditi) #57146 zlib: * (SEMVER-MINOR) add zstd support (Jan Martin) #52100 PR-URL: #57840
fix: #51740
Exporting the new
util.diff(actual, expected)
function.This function is the one internally used by the
assert
module when anAssertionError
occurs and it is just an utility to better show differences between the two paramsactual
andexpected
.It is internally using the "new"
Myers
diff algorithm so you can expect the same output provided by this PR: #54862