Please sign in to comment.
test: refactor `common.expectWarning()`
The current API is somewhat confusing at times and simpler usage is possible. This overloads the arguments further to accept objects with deprecation codes as property keys. It also adds documentation for the different possible styles. Besides that it is now going to validate for the code being present in case of deprecations but not for other cases. The former validation was not consistent as it only validated some cases and accepted undefined instead of `common.noWarnCode`. This check is removed due to the lack of consistency. `common.noWarnCode` is completely removed due to just being sugar for `undefined`. This also verifies that the warning order is identical to the order in which they are triggered. PR-URL: #25251 Reviewed-By: Daniel Bevenius <email@example.com> Reviewed-By: James M Snell <firstname.lastname@example.org>
- Loading branch information...
Showing with 119 additions and 108 deletions.
- +43 −9 test/common/README.md
- +27 −39 test/common/index.js
- +0 −2 test/common/index.mjs
- +2 −2 test/parallel/test-atomics-notify.js
- +8 −8 test/parallel/test-console.js
- +19 −19 test/parallel/test-crypto-authenticated.js
- +1 −1 test/parallel/test-crypto-cipher-decipher.js
- +6 −8 test/parallel/test-dns-lookup.js
- +2 −4 test/parallel/test-fs-filehandle.js
- +1 −2 test/parallel/test-https-strict.js
- +1 −1 test/parallel/test-process-emit-warning-from-native.js
- +1 −1 test/parallel/test-promises-unhandled-proxy-rejections.js
- +4 −4 test/parallel/test-promises-unhandled-symbol-rejections.js
- +1 −2 test/parallel/test-tls-dhe.js
- +1 −2 test/parallel/test-trace-events-api.js
- +1 −2 test/parallel/test-warn-sigprof.js
- +1 −2 test/parallel/test-worker-message-port-transfer-target.js
Oops, something went wrong.